Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

[BUG] Extreme CPU and Memory Usage #528

Closed
@m-skolnick

Description

@m-skolnick

I'm not sure if this should be a question or a bug:

Is there a way to reduce the CPU and Memory load of the plugin?

I am using VSCode. When I set dart_code_metrics as an analyzer plugin I am seeing an immediate and sustained jump in CPU and Memory usage on my Macbook Pro 2.4ghz 32gb ram.

Here is my pubspec.yaml. I'm currently on flutter version 2.5.1

name: my_flutter_package
publish_to: "none"
version: 1.0.0+1

environment:
  sdk: ">=2.12.0 <3.0.0"
  flutter: ">=2.5.0 <2.6.0"

dev_dependencies:
  dart_code_metrics: ^4.3.0
  flutter_lints: ^1.0.4

Here is my analysis_options.yaml:

include: package:flutter_lints/flutter.yaml

analyzer:
  errors:
    todo: info
    include_file_not_found: ignore
    unrelated_type_equality_checks: error
  exclude:
    - .flutter/**
    - /**/build/**
    - /**/mocks/**
    - /**/l10n/**
  plugins:
    - dart_code_metrics

dart_code_metrics:
  anti-patterns:
    - long-method
    - long-parameter-list
  metrics:
    cyclomatic-complexity: 20
    lines-of-executable-code: 50
    number-of-parameters: 4
    maximum-nesting: 5
  metrics-exclude:
    - test/**
    - .flutter/**
    - /**/build/**
    - /**/mocks/**
    - /**/l10n/**
  rules:
    - newline-before-return
    - no-boolean-literal-compare
    - no-empty-block
    - prefer-trailing-comma
    - prefer-conditional-expressions
    - no-equal-then-else

When I have the plugin in the analyzer plugins, I am seeing this in the analyzer server diagnostics:

Screen Shot 2021-10-28 at 1 20 09 PM

As soon as I remove this line and reload my VSCode, I see the following:

plugins:
  - dart_code_metrics

Screen Shot 2021-10-28 at 1 10 07 PM

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions