garybernhardt / pycomplexity Goto Github PK
View Code? Open in Web Editor NEWScripts to show cyclomatic complexity of Python code in Vim and Emacs.
Scripts to show cyclomatic complexity of Python code in Vim and Emacs.
I've seen groups of blank lines appear where they shouldn't be. When I save the file, they move downward for each save.
The whole line marking scheme is both slow and slightly wrong in vim. It'd be easiest to clear the marks each time, but that's very slow, which is out of my control since it's vim's fault. :(
I had to add ctermfg and ctermbg definitions in order to get a highlight in my terminal
hi low_complexity guifg=#004400 guibg=#004400 ctermfg=DarkGreen ctermbg=Green
hi medium_complexity guifg=#bbbb00 guibg=#bbbb00 ctermfg=DarkYellow ctermbg=Yellow
hi high_complexity guifg=#ff2222 guibg=#ff2222 ctermfg=DarkRed ctermbg=Red
Hi,
Do you have any plans to put your extension to ELPA or MELPA?
Cheers.
I needed to comment out most of it, because it was failing to find "line" key in "variables" and thus failed, i don't know if it's related to the fact i use syntastic too, that manipulate the same part of the buffer (2 leftmost columns) to point to syntax errors.
If I say "x = a or b", that's a branch (b might or might not be executed). The script already catches conditionals in ifs, but not outside of them.
When editing a new file Python will raise an IOError and it will fill the Messages window with errors similar to this:
Error detected while processing function <SNR>37_ShowComplexity:
line 3:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<string>", line 163, in show_complexity
File "<string>", line 175, in compute_scores_for
IOError: [Errno 2] No such file or directory: '/opt/devel/cms_dev/src/conf/foo.py'
Easy fix, but prefer to report it before I forget about it. I can send a pull request with a fix in the next week or so unless you beat me to it.
Code is not understandable. Comments are necessary. Please try to add comments specially in complexity.py
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.