Skip to content

Detection

Sevhena Walker edited this page Apr 4, 2025 · 3 revisions

Comprehensive Detection Workflow

Manual Detection Process

To analyze specific portions of your codebase:

  1. Navigate to the Code Smells panel and expand the project tree to locate your target file or folder.
  2. Click the magnifying glass icon next to any folder to recursively scan all contained files and subfolders.
  3. For file-specific analysis, click the magnifying glass next to the individual file.
  4. The interface will display a progress indicator during analysis. Upon completion, detected smells appear as nested items beneath the file.

Red squiggly lines show the smell detection in code.

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

Automatic Detection Features

For developers who prefer continuous feedback, EcoOptimizers offers two automatic detection modes:

  1. 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.

  2. 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:

Location of white leaf-shaped button is in the top right corner. The white color indicates its not yet been activated. Location of green leaf-shaped button is in the top right corner. The green color indicates its been activated.

  • Green outline: Automatic detection active
  • White outline: Manual detection only

Handling Modified Files

When you edit a file that's been previously analyzed, EcoOptimizers intelligently marks it as potentially outdated:

  1. The file's status icon changes to a warning triangle (⚠️)
  2. All previously detected smells for that file are temporarily hidden
  3. 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.

Refactoring

Clone this wiki locally