Comments (2)
Woah a lot to process there. Glad you liked it.
- So this is something I have been toying with #43 however in the case of Angular because its inside HTML templates it can be problematic.
What would have to happen is that the file would be scanned based on extension, and then if it sees ng-whatever
or whatever causes it to change logic flip and then reprocess that file. This is not a massive issue but annoying to implement. I am prepared to put the work in, but I would need to understand how each of the template languages work first so that I can make it flexible enough to work with all of them.
In short, yes its possible, but I need help before I start to tackle this one.
- The cost is based on the COCOMO2 model https://en.wikipedia.org/wiki/COCOMO which actually includes the cost of developing the software totally and not just the programmer cost. This means its supposed to include costs of electricity, the building you are sitting in, requirements gathering, testing etc...
COCOMO is meant to be flexible but in the case of scc
this seemed like overkill and I implemented it using the following defaults "based on organic project small team, good experience working with requirements"
The numbers can seem high at times. However in the case of scc
itself its pretty close. The project has existed for just over that many months and while I have done the majority of the work there have been a great many submissions from people like @dbaggerman and others.
If you can find a better model for estimating cost I will be happy to implement it.
-
This has come up a few times. I may need to link to some good details about COCOMO which explains this.
-
Yes, however it may be better to do so through a
.ignore
file in your repository. This is becoming the standard for files that you want added to your source control but to be ignored by tools such as ripgrep, scc, ag, vs-code and others. You can also do so at runtimescc --exclude-dir vendor,node_modules
but I would suggest .ignore is the best approach here.
I am not opposed to adding these to the default ignore list but its not something I would want to do without really understanding the impact.
-
Minified code can be detected. I do so in searchcode.com for example where I check the average line length. I have created #92
-
I belive they are not currently. COCOMO only works for code as far as I am aware. Perhaps something to turn it on? I would want to see some studies working out how you cost for this before implementing though.
-
If you can find an implementation or method for doing so. You can infer this from the complexity estimate I suppose but a formal method might be nice.
Some thoughts,
Could also add in some basic maintainability calculation perhaps?
Maintainability Index = MAX(0,(171 - 5.2 * ln(Halstead Volume)
- 0.23 * (Cyclomatic Complexity)
- 16.2 * ln(Lines of Code))*100 / 171)
https://blogs.msdn.microsoft.com/codeanalysis/2007/11/20/maintainability-index-range-and-meaning/
https://avandeursen.com/2014/08/29/think-twice-before-using-the-maintainability-index/
- The complexity estimate is really just a number that is only comparable to files in the same language. It should not be used to compare languages directly without weighting them. The reason for this is that its calculated by looking for branch and loop statements in the code and incrementing a counter for that file.
Because some languages don't have loops and must use recursion they can have a lower complexity count. Does this mean they are less complex? Probably not, but the tool cannot see this.
If you want to do this you can run scc
multiple times specifying the extension scc -i java
for example and use those numbers.
Generally though the complexity there is to help estimate between projects written in the same language, or for finding the most complex file in a project scc --by-file -s complexity
which can be useful when you are estimating on how hard something is to maintain.
I am totally turning the above into a post about how it works, because you are not the first person to ask this. https://github.com/boyter/scc#complexity-estimates
-
The tool is unaware that some code may generate other code. As such its complexity will totally be down to how many branch/loop conditions are in it. In practice though such code usually has a lot of these conditions and is the most complex when counted.
-
See 9.
-
No. Can macros be counted... not sure. Can you provide an example of how this would work. Config files... can you provide a real example.
-
No worries. Its good for me to walk though how I expect the tool to work vs what peoples perception is.
from scc.
Going to close this as no response in a while. Going to assume everything was answered to satisfaction.
Random note I am toying with the maintainability index calculation. Would be something that appears in the JSON or wide output.
from scc.
Related Issues (20)
- "Text" rather than "Plain Text"? HOT 2
- Suggested primary branch name HOT 1
- Could you please release a new version? HOT 3
- Multiple directories do not sum correctly HOT 7
- Error in 'm'ain.ts' File Prevents Installation in Go HOT 1
- Recommended install method fails due to malformed file name HOT 5
- Flag --not-match/-M not working, got ignored entirely HOT 2
- Feature: Add custom languages.json support
- Feature: Add option to count files not supported by scc
- BUG: Multicharacter support HOT 4
- Docker: aquasec/trivy reports CRITICAL and HIGH vulnerabilities HOT 1
- Malware Alerts in SCC x86 Windows Release HOT 3
- REGRESSION: Performance HOT 2
- Consider disabling comoco and size by default HOT 1
- Github action removed HOT 1
- Feature - support language Clipper HOT 10
- Migrated previous GitLab CI code to a GitLab CI/CD Component HOT 1
- Proposal: Upgrade to Go 1.22 HOT 2
- Feature: add support for shebang for R HOT 2
- ULOC missing in JSON output format HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scc.