Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use class/function names for metric_type and aggregate in list-metrics #213

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

devdanzin
Copy link
Collaborator

We currently display repr for metric_type and aggregate in list-metrics, e.g. <class 'float'> and <function mean at 0x000002C3B88BDC60>. This PR changes that to using class and function names instead, e.g. float and mean.

Before:

cyclomatic operator:
╒════════════╤═══════════════════════╤═════════════════╤═══════════════════╤═════════════════════╕
│ Name       │ Description           │ Type            │ Measure           │ Aggregate           │
╞════════════╪═══════════════════════╪═════════════════╪═══════════════════╪═════════════════════╡
│ complexity │ Cyclomatic Complexity │ <class 'float'> │ MetricType.AimLow │ <function mean at   │
│            │                       │                 │                   │ 0x000002C3B88BDC60> │
╘════════════╧═══════════════════════╧═════════════════╧═══════════════════╧═════════════════════╛
maintainability operator:
╒════════╤═════════════════════════╤═════════════════╤═════════════════════════╤═════════════════════╕
│ Name   │ Description             │ Type            │ Measure                 │ Aggregate           │
╞════════╪═════════════════════════╪═════════════════╪═════════════════════════╪═════════════════════╡
│ rank   │ Maintainability Ranking │ <class 'str'>   │ MetricType.Informationa │ <function mode at   │
│        │                         │                 │ l                       │ 0x000002C3B930C4A0> │
├────────┼─────────────────────────┼─────────────────┼─────────────────────────┼─────────────────────┤
│ mi     │ Maintainability Index   │ <class 'float'> │ MetricType.AimHigh      │ <function mean at   │
│        │                         │                 │                         │ 0x000002C3B88BDC60> │
╘════════╧═════════════════════════╧═════════════════╧═════════════════════════╧═════════════════════╛
raw operator:
╒═════════════════╤══════════════════════╤═══════════════╤═════════════════════════╤═════════════════════════╕
│ Name            │ Description          │ Type          │ Measure                 │ Aggregate               │
╞═════════════════╪══════════════════════╪═══════════════╪═════════════════════════╪═════════════════════════╡
│ loc             │ Lines of Code        │ <class 'int'> │ MetricType.Informationa │ <built-in function sum> │
│                 │                      │               │ l                       │                         │
├─────────────────┼──────────────────────┼───────────────┼─────────────────────────┼─────────────────────────┤
│ lloc            │ L Lines of Code      │ <class 'int'> │ MetricType.AimLow       │ <built-in function sum> │
├─────────────────┼──────────────────────┼───────────────┼─────────────────────────┼─────────────────────────┤
[...]

After:

cyclomatic operator:
╒════════════╤═══════════════════════╤════════╤═══════════════════╤═════════════╕
│ Name       │ Description           │ Type   │ Measure           │ Aggregate   │
╞════════════╪═══════════════════════╪════════╪═══════════════════╪═════════════╡
│ complexity │ Cyclomatic Complexity │ float  │ MetricType.AimLow │ mean        │
╘════════════╧═══════════════════════╧════════╧═══════════════════╧═════════════╛
maintainability operator:
╒════════╤═════════════════════════╤════════╤═════════════════════════╤═════════════╕
│ Name   │ Description             │ Type   │ Measure                 │ Aggregate   │
╞════════╪═════════════════════════╪════════╪═════════════════════════╪═════════════╡
│ rank   │ Maintainability Ranking │ str    │ MetricType.Informationa │ mode        │
│        │                         │        │ l                       │             │
├────────┼─────────────────────────┼────────┼─────────────────────────┼─────────────┤
│ mi     │ Maintainability Index   │ float  │ MetricType.AimHigh      │ mean        │
╘════════╧═════════════════════════╧════════╧═════════════════════════╧═════════════╛
raw operator:
╒═════════════════╤══════════════════════╤════════╤═════════════════════════╤═════════════╕
│ Name            │ Description          │ Type   │ Measure                 │ Aggregate   │
╞═════════════════╪══════════════════════╪════════╪═════════════════════════╪═════════════╡
│ loc             │ Lines of Code        │ int    │ MetricType.Informationa │ sum         │
│                 │                      │        │ l                       │             │
├─────────────────┼──────────────────────┼────────┼─────────────────────────┼─────────────┤
│ lloc            │ L Lines of Code      │ int    │ MetricType.AimLow       │ sum         │
├─────────────────┼──────────────────────┼────────┼─────────────────────────┼─────────────┤

@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2023

Codecov Report

Merging #213 (64b95f2) into master (acf39d2) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #213   +/-   ##
=======================================
  Coverage   95.46%   95.46%           
=======================================
  Files          26       26           
  Lines        1346     1346           
  Branches      287      287           
=======================================
  Hits         1285     1285           
  Misses         37       37           
  Partials       24       24           
Files Changed Coverage Δ
src/wily/commands/list_metrics.py 90.90% <ø> (ø)

@tonybaloney
Copy link
Owner

Thanks!

@tonybaloney tonybaloney merged commit b342a1c into tonybaloney:master Aug 25, 2023
20 checks passed
@devdanzin devdanzin deleted the names_in_list_metrics branch August 26, 2023 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants