🎮 Random Retro Game:
Title: Wily & Right no RockBoard: That's Paradise
Released: 1993-01-15
Platforms: Game Boy
#Wily&RightnoRockBoard:That'sParadise #GameBoy #Retrogames
🎮 Random Retro Game:
Title: Wily & Right no RockBoard: That's Paradise
Released: 1993-01-15
Platforms: Game Boy
#Wily&RightnoRockBoard:That'sParadise #GameBoy #Retrogames
So I've created a #wily report for one thousand Black (the Python formatter) commits.
You can see that there was a huge (and complex), 7k lines __init__.py that got broken up around May 2021.
There's a trend of increasing LOC and complexity.
This report shows me there's a lot to improve in wily's code. Hopefully I'm back at that.
#Python #Black #formatter #CodeStyle #Cyclomatic #Complexity #Halstead #codequality #codemetrics
Adding JSON support for #wily: now the results of diff, index, rank and report can be output as JSON.
If you can help with code review or tips on how to improve the output, I'm open to all suggestions.
Wily is a CLI application for tracking, reporting on complexity of Python code. It uses git to go through each revision and run complexity and code-analysis metrics over the code.
While stage 16 is yet to start, it is not too late to celebrate this amazing performance by #RuiCosta on stage 15. Wiliest among the #wily.
With support from #ASTTokens, we can then use #radon to collect Raw (LOC, comments, blank lines, etc.) metrics from #Python functions and methods.
After adding support for #wily to annotate source code with these metrics, we can display them inline with help from HTML and JS, as in the attached images.
Each line displays the selected metric (or all metrics) on the left. It allows quickly finding, e.g., code with too few comments or blank lines versus lines of code.
5/5
#codequality
At last, submitted a proposal for a #Python source code annotator for #wily, by @tonybaloney.
It allows inline visualization of code metrics in source code, inspired by @coveragepy
Uses #radon to calculate #Cyclomatic #Complexity and #Halstead metrics, then adds color coded metric values to a #Pygments highlighted source listing and allows changing the metrics for visualization.
The code works, there are screenshots and an example in the linked issue.
I'm bad at writing documentation, here's my latest attempt:
"""
# `wily annotate` design and implementation
`wily annotate` is a new command being proposed for addition to #wily. It works
on an already built wily cache and uses detailed metric information to add metric
values to source file listings. From its docs:
> The annotate command will generate annotated #Python source and output it to
> console or save as HTML, with metric values for a revision or single file.
[...]
"""
Today I wrote some trivial #python code to convert .gitignore rules to #radon exclude/ignore patterns. It turns out it was completely unnecessary for our project (#wily), because we already pass a tight list of targets for radon to scan.
But it might be useful for upstream radon users, as an option to gather exclude/ignore rules from .gitignore. So I'll propose that as a new feature and see how it goes.
Working on a #Python source code annotator for #wily, which uses #radon to calculate #Cyclomatic #Complexity and #Halstead metrics. It adds metric values to a #Pygments highlighted source listing and allows changing the metrics for visualization.
Because radon doesn't record line numbers for Halstead metrics, we do a little song and dance to add them. Will probably offer a patch to include them upstream.
https://devdanzin.github.io/wily/annotated_src.annotator.py.html
@bmaxv @pybites Have you heard about wily, which allows you to report and graph history of Cyclomatic Complexity and other metrics (Maintenability Index, Halstead, etc.)? It used radon to get the metrics and goes through the Git history of a project using its visitors.
I'm currently adding the ability to generate annotated source files with metric values. Here's an example: https://devdanzin.github.io/wily/annotated_src.wily.commands.build.py.html
Some more #Python code quality visualization improvements for #wily: it's now possible to annotate source code with #Halstead metrics (#Cyclomatic #Complexity was already working) and select which one to display and use to color code blocks.
See a sample report here: https://devdanzin.github.io/wily/ (click the filenames for the annotated source code).
Code for the annotator currently lives at https://github.com/devdanzin/wily/tree/annotated_source, I hope to submit it for upstreaming soon-ish.
Working on wily[0] so it can generate reports and graphs on code metrics(LOC, Cyclomatic Complexity etc.) for a whole #Python project at once.
It also annotates source code with metrics (only Cyclomatic Complexity so far).
Example bulk report: https://devdanzin.github.io/wily/
🐍