Skip to content

Configuration

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

Filter Panel Capabilities

The Filter Smells panel offers granular control over what gets detected and how:

All filter smells in the designated Filter Smells view have been selected.

  1. Smell Type Toggles:
    Simple on/off switches for each of the eight supported smell types:

    • Cache Repeated Calls
    • Long Lambda Functions
    • Use A Generator
    • Long Element Chain
    • Member Ignoring Method
    • Long Message Chain
    • String Concatenation in Loop
    • Long Parameter List
  2. Threshold Adjustments:
    For five configurable smells, interactive controls let you set detection sensitivity:

    • Cache Repeated Calls: Minimum identical calls to trigger (default: 3)
    • Long Element Chain: Minimum chain length (default: 4)
    • Long Lambda Functions: Minimum character length (default: 50)
    • Long Message Chain: Minimum call chain length (default: 5)
    • Long Parameter List: Minimum parameters (default: 5)

Available options and settings under each dropdown. Some examples include threshold and lambda length. User can enter a new threshold value in the top action menu.

  1. Preset Management:
    Convenience buttons at the panel bottom provide:
    • "Select All": Enable all smell types
    • "Deselect All": Disable all detection
    • "Reset Defaults": Restore factory settings

Click on the three-dots menu to see the options to deselect/select all smells or set filter defaults.

Practical Configuration Tips

Consider these strategies when setting up your detection:

  1. Project Phase Adjustments:

    • Early Development: Enable all smells with lower thresholds for strict quality control
    • Maintenance Phase: Focus on high-impact smells with higher thresholds
  2. Team Standards Alignment:
    Configure thresholds to match your organization's style guide requirements

  3. Performance Tradeoffs:
    Lower thresholds increase detection accuracy but may slightly impact analysis speed on large codebases

All filter settings persist between VS Code sessions and are workspace-specific, allowing different configurations for different projects.

Customization Options

Visual Styling Preferences

EcoOptimizers offers multiple ways to personalize how code smells appear in your editor:

EcoOptimizer can be found as a seperate menu item in the Settings page.

  1. Highlight Style Selection:
    Accessible through VS Code settings (File > Preferences > Settings > Extensions > EcoOptimizers), choose from three visual treatments:

    • Underline: Traditional squiggly underline (default)
    • Flashlight: Subtle background highlight with fading edges
    • Border-Arrow: Left border indicator with hover-triggered annotation
  2. Color Customization:
    The extension provides two complementary approaches to color configuration:

    Per-Smell Coloring:

    • Edit the "Smell Colours" table to assign specific colors to each smell type
    • Uses standard CSS color values (hex, rgb, or named colors)
    • Example: "Long Lambda Functions": "#FFA500" for orange

    Uniform Coloring:

    • Enable "Use Single Colour" to apply one color to all smell types
    • Set the universal color in "Single Highlight Colour"
    • Useful for simplified visual parsing
  3. Accessibility Considerations:
    The default color palette is designed for color vision deficiency awareness. When customizing, ensure sufficient contrast with your theme's background.

Settings Management

All customization options are available through:

  1. The standard VS Code Settings UI (GUI editor)
  2. Direct editing of settings.json
  3. Workspace-specific configuration files

Changes take effect immediately without requiring restart, allowing real-time experimentation with different visual styles.

Clone this wiki locally