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

File types not detected properly #1188

Closed
BridgeAR opened this issue Aug 26, 2020 · 5 comments · Fixed by #1469
Closed

File types not detected properly #1188

BridgeAR opened this issue Aug 26, 2020 · 5 comments · Fixed by #1469
Labels
bug Only issues that describe bugs. difficulty:medium The difficulty to solve this is not super complex but not easy either java Pull requests that update Java code. Usually created by Dependabot. javascript Pull requests that update Javascript code. Usually created by Dependabot. pr-analysis Issues that touch the analysis pr(oject). pr-visualization Issues that touch the visualization pr(oject) which means web and desktop features. priority:high Set by PO

Comments

@BridgeAR
Copy link
Member

BridgeAR commented Aug 26, 2020

Bug

Expected Behavior

GIVEN a map consisting out of multiple programming languages, e.g. 50% java and 50% javascript

THEN the programming language indicator should be 50/50.

Actual Behavior

The language indicator is far off and shows e.g., 95% javascript.

Steps to Reproduce the Problem

Let's chat about it.

Notes

I am if the cc.json already contains the percentages or if the frontend determines that from the file ending. Ideally it would be available in the cc.json, since it's possible to maybe even check the files. There are tools that determine the percentages properly and we should check what is off.

Specifications

  • is released in online-demo: yes
  • CodeCharta Version: v1.54.0
  • OS: Ubuntu 20.04
  • Browser: Chromium
@BridgeAR BridgeAR added bug Only issues that describe bugs. pr-visualization Issues that touch the visualization pr(oject) which means web and desktop features. pr-analysis Issues that touch the analysis pr(oject). java Pull requests that update Java code. Usually created by Dependabot. javascript Pull requests that update Javascript code. Usually created by Dependabot. priority:high Set by PO difficulty:medium The difficulty to solve this is not super complex but not easy either labels Aug 26, 2020
@NearW
Copy link
Contributor

NearW commented Aug 26, 2020

That is only true, when you select unary as the distributionbar-metric. The distribution is based on a metric. I can't see what metric was selected, but it might be, that this metric is only available in java files?

@BridgeAR
Copy link
Member Author

Good point. I was not aware that we handle our indicator like that 😆 It does indeed show the expected behavior when choosing lines of code. This behavior does seem very surprising though, that it does not just use the lines of code but also other metrics. I can not think of a use case for the file type indicator that uses other metrics than loc.

The default metric is bugged with that cc.json:

image

I wonder what would be best to handle cases like these and what the actual bug is about.

@NearW
Copy link
Contributor

NearW commented Aug 27, 2020

Interesting. I've never seen a metric without a name in there before.
Can you .zip the cc.json and post it here for further investigation?

@ce-bo
Copy link
Collaborator

ce-bo commented Oct 30, 2020

Bugfix needed: Please skip empty metrics in the select-box.

@ce-bo
Copy link
Collaborator

ce-bo commented Oct 30, 2020

Improvements:

  • Look for rloc, if it is present, choose it as the default metric.
  • If no default metric could be found, choose the unary metric, so that the amount of files per programming language is visible.

RomanenkoVladimir added a commit that referenced this issue Nov 5, 2020
… unary to default if no rloc, Set to any if no rloc or unary #1188
RomanenkoVladimir added a commit that referenced this issue Nov 5, 2020
RomanenkoVladimir added a commit that referenced this issue Nov 5, 2020
RomanenkoVladimir added a commit that referenced this issue Nov 5, 2020
RomanenkoVladimir added a commit that referenced this issue Nov 6, 2020
RomanenkoVladimir added a commit that referenced this issue Nov 6, 2020
ce-bo added a commit that referenced this issue Nov 6, 2020
* Change string sorting to localeCompare #1092

* Change sorting to Intl.Collator #1092

* Remove empty metric for top-bar, Set rloc to default if avalible, Set unary to default if no rloc, Set to any if no rloc or unary #1188

* Update Changelog #1188

* Revert "Update Changelog #1188"

This reverts commit 01c1957.

* Update Changelog #1188

* Remove irrelevant fail-safes #1188

* Add test #1092

* Update Changelog #1092

Co-authored-by: Cedrik Bormann <26900540+ce-bo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Only issues that describe bugs. difficulty:medium The difficulty to solve this is not super complex but not easy either java Pull requests that update Java code. Usually created by Dependabot. javascript Pull requests that update Javascript code. Usually created by Dependabot. pr-analysis Issues that touch the analysis pr(oject). pr-visualization Issues that touch the visualization pr(oject) which means web and desktop features. priority:high Set by PO
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants