codecharta icon indicating copy to clipboard operation
codecharta copied to clipboard

Copy filenames to clipboard, according to all metrics

Open Christian-Eberhard opened this issue 2 years ago • 8 comments

Feature request

Description

As a CodeCharta, I want to copy the filenames of the highest / widest buildings so that i do not have to type every single filename myself.

Acceptance criteria

  • [x] Button for copying filenames
  • [x] Entries should be copied in plaintext
  • [x] rloc: Filenames of Top 10 highest/widest buildings with metric value should be copied
  • [x] selected metrics: Filenames of Top 10 highest/widest buildings with metric value should be copied
  • [x] all metrics: Filenames of Top 10 highest/widest buildings with metric value should be copied

Clipboard text looks approximately like this:

rloc

  • File1: value
  • File2: value
  • File3: value
  • File4: value
  • ...
  • File10: value

mcc   ... like rloc ...

Open questions

Where in the UI should this functionality be?

Christian-Eberhard avatar Mar 21 '22 14:03 Christian-Eberhard

This is actually a pretty important feature for audits. As such I just changed the priority.

BridgeAR avatar Jul 22 '22 00:07 BridgeAR

The logic for this feature needs to evaluate which values are considered problematic for every single metric (high or low). How should this be handled? There is already the feature of inverting colors in the visualization part for this problem. @knoffi suggested saving the individual metric values with different leading signs (e.g. test coverage with negative values because small values are considered "good") in the JSONs, which automatically will lead to adjustments in the analysis part. Compatibility of older JSONs also needs to be kept in mind.

@BridgeAR @ce-bo

LuisGuenther avatar Aug 08 '22 12:08 LuisGuenther

@LuisGuenther please see https://github.com/MaibornWolff/codecharta/pull/2942#discussion_r939909423

ce-bo avatar Aug 08 '22 13:08 ce-bo

@BridgeAR @ce-bo We have an example how we implemented the list yet:

RLOC
    • sample2LeafMergedIn.kt (600)
    • sample1OnlyLeaf.scss (400)
    • bigLeaf.ts (120)
    • bigLeaf.ts (100)
    • otherSmallLeaf.ts (70)
    • otherSmallLeaf.ts (70)
    • smallLeaf.html (30)
    • smallLeaf.html (30)
FUNCTIONS
    • otherSmallLeaf.ts (1000)
    • smallLeaf.html (101)
    • smallLeaf.html (100)
    • sample2LeafMergedIn.kt (10)
    • otherSmallLeaf.ts (10)
    • bigLeaf.ts (10)
    • bigLeaf.ts (10)
    • sample1OnlyLeaf.scss (10)
MCC
    • otherSmallLeaf.ts (100)
    • smallLeaf.html (100)
    • sample1OnlyLeaf.scss (100)
    • smallLeaf.html (80)
    • otherSmallLeaf.ts (10)
    • sample2LeafMergedIn.kt (1)
    • bigLeaf.ts (1)
    • bigLeaf.ts (1)
PAIRINGRATE
    • bigLeaf.ts (77)
    • otherSmallLeaf.ts (65)
    • smallLeaf.html (60)
    • sample1OnlyLeaf.scss (32)
    • sample2LeafMergedIn.kt (0)
    • otherSmallLeaf.ts (0)
    • smallLeaf.html (0)
    • bigLeaf.ts (0)
AVGCOMMITS
    • bigLeaf.ts (56)
    • smallLeaf.html (51)
    • otherSmallLeaf.ts (22)
    • sample1OnlyLeaf.scss (17)
    • sample2LeafMergedIn.kt (0)
    • otherSmallLeaf.ts (0)
    • smallLeaf.html (0)
    • bigLeaf.ts (0)
UNARY
    • sample2LeafMergedIn.kt (1)
    • otherSmallLeaf.ts (1)
    • smallLeaf.html (1)
    • otherSmallLeaf.ts (1)
    • smallLeaf.html (1)
    • bigLeaf.ts (1)
    • bigLeaf.ts (1)
    • sample1OnlyLeaf.scss (1)

Do you like it? We could also add the file path to every file name. Is it useful to see the metric value per filename?

Hall-Ma avatar Aug 09 '22 14:08 Hall-Ma

I would add the file path in case of duplicate file names. The metric value in braces is nice!

ce-bo avatar Aug 09 '22 16:08 ce-bo

Maybe we can add a Headline that the following files are the worst per metric.

ce-bo avatar Aug 09 '22 16:08 ce-bo

UNARY     • sample2LeafMergedIn.kt (1)

As an idea: Maybe we could start with the value, then the file name and afterwards the link. In that case the values would nicely align vertically, the file name which is the most important would be obvious and optional the path at the end can be read.

UNARY
    • (19)    sample2LeafMergedIn.kt    app/source/mergeTools

shaman-apprentice avatar Aug 12 '22 07:08 shaman-apprentice

The list is meant for auditors and they need the full path for the file to know what file to look into. It's not about how it's arranged. The actual values are not even that important. As such, please format it as:

RLOC
    • path/sample2LeafMergedIn.kt (600)
    • path/sample1OnlyLeaf.scss (400)
    • path/one/bigLeaf.ts (120)
    • path/two/bigLeaf.ts (100)
    • path/one/otherSmallLeaf.ts (70)
    • path/two/otherSmallLeaf.ts (70)
    • path/one/smallLeaf.html (30)
    • path/two/smallLeaf.html (30)

BridgeAR avatar Aug 12 '22 07:08 BridgeAR