Repository: godotengine/godot
File: editor/file_system/dependency_editor.cpp (C++)

Code before:
			item->set_custom_color((int)DependencyEditorColumn::PATH, Color(1, 0.4, 0.3));
			missing.push_back(path);
			broken = true;
		}

		item->add_button((int)DependencyEditorColumn::PATH, folder, 0);
	}

	fixdeps->set_disabled(!broken);
}

void DependencyEditor::edit(const String &p_path) {
	editing = p_path;
	set_title(TTR("Dependencies For:") + " " + p_path.get_file());

	filter->set_text("");
	sort_by = DependencyEditorSortBy::PATH;

	_update_menu_sort();
	_update_list();

	if (EditorNode::get_singleton()->is_scene_open(p_path)) {
		warning_label->show();
		warning_label->set_text(vformat(TTR("Scene \"%s\" is currently being edited. Changes will only take effect when reloaded."), p_path.get_file()));
		warning_label->show();
		warning_label->set_text(vformat(TTR("Scene \"%s\" is currently being edited. Changes will only take effect when reloaded."), p_path.get_file()));
	} else if (ResourceCache::has(p_path)) {
		warning_label->show();
		warning_label->set_text(vformat(TTR("Resource \"%s\" is in use. Changes will only take effect when reloaded."), p_path.get_file()));
	} else {
		warning_label->hide();
	}
	popup_centered_ratio(0.4);
}

void DependencyEditor::_filter_changed(const String &p_text) {
	_update_list();
}

void DependencyEditor::_sort_popup(int p_id) {
	sort_by = (DependencyEditorSortBy)p_id;
	_update_menu_sort();
	_update_list();
}

void DependencyEditor::_update_menu_sort() {
	for (int i = 0; i != (int)DependencyEditorSortBy::MAX; i++) {
		menu_sort->get_popup()->set_item_checked(i, (i == (int)sort_by));
	}
}


Review comment (refactor):
Looks like some duplicate mistake.
```suggestion
```

Code after:
DependencyEditor::DependencyEditor() {
	VBoxContainer *vb = memnew(VBoxContainer);
	add_child(vb);

	tree = memnew(Tree);
	tree->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
	tree->set_theme_type_variation("TreeTable");
	tree->set_hide_folding(true);
	tree->set_columns((int)Column::MAX);
	tree->set_column_titles_visible(true);
	tree->set_column_title((int)Column::TYPE, TTRC("Type"));
	tree->set_column_clip_content((int)Column::TYPE, true);
	tree->set_column_expand_ratio((int)Column::TYPE, 2);
	tree->set_column_title((int)Column::NAME, TTRC("Name"));
	tree->set_column_clip_content((int)Column::NAME, true);
	tree->set_column_expand_ratio((int)Column::NAME, 3);
	tree->set_column_title((int)Column::PATH, TTRC("Path"));
	tree->set_column_clip_content((int)Column::PATH, true);
	tree->set_column_expand_ratio((int)Column::PATH, 5);
	tree->set_hide_root(true);
	tree->connect("button_clicked", callable_mp(this, &DependencyEditor::_load_pressed));

	HBoxContainer *hbc = memnew(HBoxContainer);
	Label *label = memnew(Label(TTR("Dependencies:")));
	label->set_theme_type_variation("HeaderSmall");

	hbc->add_child(label);
	hbc->add_spacer();
	fixdeps = memnew(Button(TTR("Fix Broken")));
	hbc->add_child(fixdeps);
	fixdeps->connect(SceneStringName(pressed), callable_mp(this, &DependencyEditor::_fix_all));

	vb->add_child(hbc);

	HBoxContainer *hbc_filter = memnew(HBoxContainer);
	vb->add_child(hbc_filter);
	filter = memnew(LineEdit);
	filter->set_accessibility_name(TTRC("Filter Dependencies"));
	filter->set_placeholder(TTRC("Filter Dependencies"));
	filter->set_clear_button_enabled(true);
	filter->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	filter->connect(SceneStringName(text_changed), callable_mp(this, &DependencyEditor::_update_list).unbind(1));
	hbc_filter->add_child(filter);

	menu_sort = memnew(MenuButton);
	menu_sort->set_flat(false);
	menu_sort->set_theme_type_variation("FlatMenuButton");
	menu_sort->set_tooltip_text(TTRC("Sort Dependencies"));
	menu_sort->set_accessibility_name(TTRC("Sort Dependencies"));

	PopupMenu *popup_sort = menu_sort->get_popup();