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 · 4 comments
Closed

Unique Lines of Code - Feature Request #355

exwhyz opened this issue Nov 22, 2022 · 4 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 added this to ToDo in Release 3.2.0 Nov 22, 2022
@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
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
Status: Done
Development

No branches or pull requests

2 participants