sumeet / method_length

Prints out method lengths for Python files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prints out method lengths for Python files.

Examples

Longest methods in a project

$ find . -name '*.py' | xargs -n1 python ./method_length.py | sort -nr | head
4    test_finds_method_lengths (./test.py)
3    test_ignores_docstrings (./test.py)
3    last_line (./method_length.py)
3    find_method_lengths (./method_length.py)
2    docstring_length (./method_length.py)
1    length (./method_length.py)
1    get_line_no (./method_length.py)

Average length for a project

$ alias average='awk '\''{ total += $1; count++ } END { print total/count }'\'
$ find . -name '*.py' | xargs -n1 python ./method_length.py | average
2.42857

About

Prints out method lengths for Python files

License:MIT License


Languages

Language:Python 100.0%