Comments (1)
@pylipp that's a great question and one that I don't quite know the answer to yet. The algorithm we use is one very quickly hacked together that correlated with what we were seeing generally from rubycritic from one of our moderately large internal Rails codebases (~100kloc).
When I run the tool, I'm doing a numeric sort complexity | sort -n --reverse | head -n 20
to get a sense of where to focus within new codebases. There might be too strong a correlation with file length βΒ and the algorithm can be adjusted if that's the case.
If the score of a file is < 100, it's likely it's going to be easy to grok. Again, this is an approximation tool, and not one that interprets files. I don't expect that to change anytime soon.
I did break apart scoring to use the visitor pattern as a way to encourage other algorithms/approaches be used. I would imagine this could be configurable on a per-file-type basis eventually, or score differently for files that don't "roll back up" like Haskell or Elm versus Ruby or Elixir.
The current algorithm: 7fb66a2#diff-0e83e34ba12421d41f8a2e93ca67eff995ef8511c656b50a56e45fc9167d8abe
The current scoring structure that uses the scoring visitor:
Lines 14 to 40 in 4112cda
The current written-out way to read the current scoring algorithm: 7fb66a2#diff-12b7e19d8f3e5e1cf0dbe75aff102362944bb1cf00c4634b2aec22fe393c16e9R115-R133
from complexity.
Related Issues (7)
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 complexity.