Comments (5)
Hi Damian,
the code that calculates the complexity of an expression or an operator application is very straightforward:
Lines 53 to 66 in b81c34e
You are right that cyclomatic complexity is usually defined for imperative programs. In fact, this project was born as nothing more than an Haskell exercise for myself. It's basically a port of another project of mine, Radon, which does the same but for Python code. Radon's documentation goes a little bit more in depth, and has a couple of references:
http://radon.readthedocs.io/en/latest/intro.html#cyclomatic-complexity
As you may have noticed, the project hasn't been updated in a lot of time. So if you want to step in as a maintainer, I will happily add you as collaborator.
from argon.
Thanks for replying Michele!
I've cloned you're repo last weekend, and I'm updating it to the latest stack LTS. So I might submit a pull request soon. I don't know if adding me as a mantainer will make things easier, but we could wait till I make the PR.
My intention is to use Argon inside an engine for code-climate.
Thanks for the references to the way you calculate the cyclomatic complexity. I have one question about the code above though: do you add any complexity in the case of recursion? Or what about calling other functions?
from argon.
Excellent, I'll wait for the PR then.
No, recursion does not impact CC, and neither does calling other functions. This is because the original definition of McCabe states that CC is the number of possible path that the code execution can take. If one isn't using callbacks, functions don't have an impact on this.
from argon.
Thanks for the explanation Michele.
I'm trying to put the hierarchy
and pipes-files
into Stackage again, and then I'll submit the PR to argon
, so it might take a while before the PR comes through.
from argon.
Ok, there's no hurry. Yes Argon was in Stackage but then it was removed due to its dependencies.
from argon.
Related Issues (20)
- It doesn't seem to like signatures on pattern synonyms: HOT 5
- fails to parse CPP testing MIN_VERSION... HOT 3
- ScopedTypeVariables does not work with GHC 7.8
- Add -I --include option HOT 3
- Use a streaming library to export parsed data HOT 2
- Add -c, --cabal option
- Solve TypeFamilies and Foreign Import GHC panics
- Increase test coverage
- Add filesystem traversal to the pipeline
- Extensions from the cabal file are not picked up HOT 6
- CPP preprocessing error in the hint library HOT 7
- ExplicitForAll errors, even when RankNTypes is enabled HOT 10
- Explanations on the Config datatype HOT 5
- Search cabal file automatically
- Stack Support HOT 1
- Odd error about 'DatatypeContexts'
- Cyclomatic Complexity calculation error HOT 5
- Unsupported extension: TypeApplications HOT 1
- Cannnot compile HOT 3
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 argon.