dart-code-metrics icon indicating copy to clipboard operation
dart-code-metrics copied to clipboard

[Question] How to generate multiple package repository report (HTML) in single one metrics folder?

Open stevanusw28 opened this issue 3 years ago • 3 comments

What do you want to discuss?

Hi, thank you for this great package!

I want to ask is there any way to combine the report file (in HTML) for multiple package repository in single one file? Example I have three package module like this:

feature_a feature_b feature_c

I want to generate single html metrics folder in root repository that contain all the report from these three package (instead of separated metrics folder in each package).

Is there any way to combine the result into single metrics folder?

stevanusw28 avatar Jan 12 '22 01:01 stevanusw28

@stevanusw28 hi! Do you use melos for manage packages in monorepo or you user another tool? What do you want to see on title (index.html) page?

dkrutskikh avatar Jan 13 '22 18:01 dkrutskikh

Yes @dkrutskikh , I use melos for manage the packages. I want to see all the dart code metrics file inside one index.html in one folder metrics in the root project instead of see metrics result in each module.

This is my melos.yaml file

name: modular_app

packages:
  - module/**

scripts:
  metrics:
    run: |
      melos exec -c 1 --ignore="*example*" -- \
        flutter pub run dart_code_metrics:metrics lib --reporter=html --cyclomatic-complexity=20 --halstead-volume=300 --lines-of-code=80 --maximum-nesting-level=5 --source-lines-of-code=50 --number-of-parameters=5 --technical-debt=1
    description: |
      Run `dart_code_metrics` in all packages.
      - Note: you can also rely on your IDEs Dart Analysis / Issues window.

This is my structure project like this

lib
	main.dart (This is main dart for root project)
module
	feature_a
		lib
		test
		pubspec.yaml
		metrics (the metrics report result for feature A)
	feature_b
		lib
		test
		pubspec.yaml
		metrics (the metrics report result for feature B)
	feature_c
		lib
		test
		pubspec.yaml
		metrics (the metrics report result for feature C)
pubspec.yaml

What I want to see is the metrics result for all project in just one folder metrics like this:

lib
	main.dart (This is main dart for root project)
metrics (the index.html contain report for root project, feature_a, feature_b, feature_c)
module
	feature_a
		lib
		test
                pubspec.yaml
	feature_b
		lib
		test
                pubspec.yaml
	feature_c
		lib
		test
                pubspec.yaml
pubspec.yaml

Is this possible?

stevanusw28 avatar Jan 14 '22 06:01 stevanusw28

@stevanusw28 currently we work on support mono repos in analyze task, as part of this work, we will rework html report

dkrutskikh avatar Mar 30 '22 16:03 dkrutskikh

I am also very interested in it. We currently have an app that integrates a framework with various packages. Here we would like to generate the metrics for the app with the framework and all packages together in one report.

We can connect a coverage report because we have a lcov file. The metrics, however, as far as we know not.

DFelten avatar Oct 24 '22 15:10 DFelten

Available in Teams 1.3.0

incendial avatar Apr 06 '23 18:04 incendial