Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow adding class names to method names for Halstead metric (fix #175) #247

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

devdanzin
Copy link
Contributor

This PR add a --class_names option to radon hal -f that prefixes method names with their class names.

Before:

> python -m radon hal -f .\radon\visitors.py
[...]
    visit_ClassDef:
        h1: 1
        h2: 2
        N1: 2
        N2: 4
        vocabulary: 3
        length: 6
        calculated_length: 2.0
        volume: 9.509775004326938
        difficulty: 1.0
        effort: 9.509775004326938
        time: 0.5283208335737188
        bugs: 0.003169925001442313

After:

> python -m radon hal -f --class-names .\radon\visitors.py
[...]
    HalsteadVisitor.visit_ClassDef:
        h1: 1
        h2: 2
        N1: 2
        N2: 4
        vocabulary: 3
        length: 6
        calculated_length: 2.0
        volume: 9.509775004326938
        difficulty: 1.0
        effort: 9.509775004326938
        time: 0.5283208335737188
        bugs: 0.003169925001442313

I mistakenly committed to master, then created this branch from it. If that causes issues I can send another PR without commits to master.

Fixes #175.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: classname with radon hal -f
1 participant