-
Notifications
You must be signed in to change notification settings - Fork 1
Detection
To analyze specific portions of your codebase:
- Navigate to the Code Smells panel and expand the project tree to locate your target file or folder.
- Click the magnifying glass icon next to any folder to recursively scan all contained files and subfolders.
- For file-specific analysis, click the magnifying glass next to the individual file.
- The interface will display a progress indicator during analysis. Upon completion, detected smells appear as nested items beneath the file.

Each detected smell entry shows:
- The specific smell type (e.g., "Long Lambda Function")
- The line number where it occurs
- Interactive icons for immediate refactoring
For developers who prefer continuous feedback, EcoOptimizers offers two automatic detection modes:
-
On-Save Detection:
When enabled (via the leaf icon in the editor toolbar), the extension will automatically reanalyze any file when you save changes. This ensures your smell detection stays current with your latest modifications. -
File-Switch Detection:
Also controlled by the leaf icon, this feature triggers analysis when you change focus to a different file tab in VS Code. This is particularly useful when navigating large codebases.
The leaf icon serves as a toggle:

- Green outline: Automatic detection active
- White outline: Manual detection only
When you edit a file that's been previously analyzed, EcoOptimizers intelligently marks it as potentially outdated:
- The file's status icon changes to a warning triangle (
⚠️ ) - All previously detected smells for that file are temporarily hidden
- The description text on the file says "outdated".
This design prevents you from acting on potentially stale detection results while clearly indicating which files need fresh analysis. Simply click the magnifying glass icon to update the file's smell detection.