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

Unique Lines of Code - Feature Request #355

Closed
exwhyz opened this issue Nov 22, 2022 · 10 comments
Closed

Unique Lines of Code - Feature Request #355

exwhyz opened this issue Nov 22, 2022 · 10 comments
Labels
enhancement New feature or request

Comments

@exwhyz
Copy link

exwhyz commented Nov 22, 2022

Are there any plans to add a means to compute the unique lines of code? Here is an example at the link blow - please scroll down to the last 2 charts at the bottom of the page for reference:

https://xpra.org/stats/source/

Also there is some discussion here on a related subject:

https://cmcenroe.me/2018/12/14/uloc.html

@exwhyz exwhyz changed the title Unique Line of Code Feature Unique Lines of Code - Feature Request Nov 22, 2022
@boyter
Copy link
Owner

boyter commented Nov 22, 2022

That's an interesting thought.

I might just do that!

@boyter boyter added the enhancement New feature or request label Nov 22, 2022
@boyter boyter moved this to In Progress in Release 3.3.0 Apr 30, 2024
@boyter
Copy link
Owner

boyter commented Apr 30, 2024

Added... a primitive version of this into scc just then to see how difficult it would be. The answer being not very. I still need to fix this to work across languages, which might take some other flags, but it currently works across all files.

$ scc --uloc
───────────────────────────────────────────────────────────────────────────────
Total Unique Source Lines of Code (ULOC)                                  24639
───────────────────────────────────────────────────────────────────────────────

which gives a number similar to the link mentioned. Now id like to see it as your first link shows broken down by language, but that's next on the list. Still some progress is there.

@boyter
Copy link
Owner

boyter commented May 1, 2024

$ scc -u -i c -a linux
───────────────────────────────────────────────────────────────────────────────
Language                 Files     Lines   Blanks  Comments     Code Complexity
───────────────────────────────────────────────────────────────────────────────
C                        30415  21144200  3055939   2458987 15629274    2141633
(ULOC)                           9155799
───────────────────────────────────────────────────────────────────────────────
Total                    30415  21144200  3055939   2458987 15629274    2141633
───────────────────────────────────────────────────────────────────────────────
Unique Lines of Code (ULOC)      9155799
DRYness %                           0.43
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop (organic) $684,275,627
Estimated Schedule Effort (organic) 164.36 months
Estimated People Required (organic) 369.87
───────────────────────────────────────────────────────────────────────────────
Processed 574064691 bytes, 574.065 megabytes (SI)
───────────────────────────────────────────────────────────────────────────────

Added in a DRYness calculation which indicates how much repetition there is in the code. Higher values indicate less duplicate code hence making it more DRY as a solution.

@boyter
Copy link
Owner

boyter commented May 2, 2024

Added to all output formats considering this done with the 3.3.0 release.

@boyter boyter closed this as completed May 2, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Release 3.3.0 May 2, 2024
@gms8994
Copy link

gms8994 commented Sep 30, 2024

@boyter is this being released to the docker image? Neither of these options seem available when pulling ghcr.io/lhoupert/scc:master

@boyter
Copy link
Owner

boyter commented Oct 1, 2024

@gms8994 If the image has the latest it should get it...

Now the question is, am I maintaining that, or should I be. Do you mean the one in the repo or some other one?

@gms8994
Copy link

gms8994 commented Oct 1, 2024

The readme mentions a docker image that can be run. I just pulled that, and tried to run docker run --rm -i -v "$PWD:/pwd" ghcr.io/lhoupert/scc:master scc --dryness and got Error: unknown flag: --dryness. I see that it was built 8 months ago via docker image ls, which I think would be about a month before this issue was resolved?

@gms8994
Copy link

gms8994 commented Oct 1, 2024

Just a note that docker run --rm -i -v "$PWD:/pwd" ghcr.io/lhoupert/scc:master scc --version outputs scc version 3.3.0 (beta). I'm assuming that means something isn't correctly updating in the github workflow from #425 ?

@gms8994
Copy link

gms8994 commented Oct 1, 2024

Specifically, I see that the dockerfile is checking out a specific version that may not be what's actually wanted? https://github.com/boyter/scc/blob/master/Dockerfile#L7

@boyter
Copy link
Owner

boyter commented Oct 1, 2024

Tweaked the dockerfile just then which should fix it I think. Ill add it to the checklist of things to update when a release is pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants