Package: pcc-calc
PythonCyclomaticComplexityCaculatorInstallation|Usage|ExamplesEnglish|简体中文FeaturesCyclomatic complexity is acode quality metricmulti charset support.(this may lead slow)pretty outputInstallationpipinstallpcc-calc==0.0.2you need download or build library first.pcc./tests/data/python3Doyouwanttocreat[/your/path/pcc/.pcc]?[y/N]:y
CreateDir[/your/path/pcc/.pcc]success!
Doyouwanttodowloadonefrom[/your/path/pcc/.pcc/libpcc_ts_all.so]?[y/N]:y
Download[/your/path/pcc/.pcc]success!CodeCyclomaticComplexityCaculator|Complexity|Function|File||------------|-------------------|---------------------------------------------------------||6|class|/your/path/pcc/tests/data/python3/directory/class.py:15||6|myfun|/your/path/pcc/tests/data/python3/directory/class.py:32||6|myfun2|/your/path/pcc/tests/data/python3/directory/class.py:52||4|function_in_file2|/your/path/pcc/tests/data/python3/directory/file2.py:1||2|if_statment_0|/your/path/pcc/tests/data/python3/ifs.py:2||2|if_statment_1|/your/path/pcc/tests/data/python3/ifs.py:8||2|function_in_file1|/your/path/pcc/tests/data/python3/directory/file1.py:1||1|get_url|/your/path/pcc/tests/data/python3/directory/class.py:7||1|class|/your/path/pcc/tests/data/python3/directory/class.py:12|Procee[4]filesuseTime:0.022909164428710938sUsagepcc--help
Usage:pcc[OPTIONS]CODE_PATHCyclomaticComplexityCaculator

Options:-j,--jobsINTEGERParalleljobscount[default:10]-c,--countINTEGEROutputitemcount[default:10]-s,--sortBOOLEANsortbyComplexity[default:True]-e,--exclude_pathDIRECTORYexcludepath--lib_pathDIRECTORYtree-sitterlibrarypath[default:.pcc/]--version--helpShowthismessageandexit.Examplescaculate one filepcc./pcc/pcc.pyCodeCyclomaticComplexityCaculator|Complexity|Function|File||------------|--------------------------------|--------------------------------||2|get_vistor|/your/project/pcc/pcc/pcc.py:19||2|get_parser|/your/project/pcc/pcc/pcc.py:26||1|detect_file_lanuage|/your/project/pcc/pcc/pcc.py:14||1|parse_code|/your/project/pcc/pcc/pcc.py:33||1|calc_code_complexity|/your/project/pcc/pcc/pcc.py:37||1|calc_code_complexity_from_file|/your/project/pcc/pcc/pcc.py:49|caculate directorypcc.-j8-e./venv-e./docs-e./languagesCodeCyclomaticComplexityCaculator|Complexity|Function|File||------------|-----------------------|-----------------------------------------------------------||7|class|/your/project/pcc/pcc/python/vistor_impl.py:94||7|class|/your/project/pcc/pcc/python/vistor_impl.py:117||7|class|/your/project/pcc/build/lib/pcc/python/vistor_impl.py:94||7|class|/your/project/pcc/build/lib/pcc/python/vistor_impl.py:117||6|travel_dir_and_filter|/your/project/pcc/pcc/utils.py:33||6|check_or_download|/your/project/pcc/pcc/cli.py:38||6|class|/your/project/pcc/tests/data/python3/directory/class.py:15||6|myfun|/your/project/pcc/tests/data/python3/directory/class.py:32||6|myfun2|/your/project/pcc/tests/data/python3/directory/class.py:52||6|travel_dir_and_filter|/your/project/pcc/build/lib/pcc/utils.py:33|Procee[37]filesuseTime:0.04288077354431152sas u can see,-ecan exclude directory you don't want, and can use multi times.multilang support$pcc./tests/data/CodeCyclomaticComplexityCaculator|Complexity|Function|File||------------|-------------------|------------------------------------------------------------------------------||6|class|/home/sss/cyclomatic_complexity/pcc/tests/data/python3/directory/class.py:15||6|myfun|/home/sss/cyclomatic_complexity/pcc/tests/data/python3/directory/class.py:32||6|myfun2|/home/sss/cyclomatic_complexity/pcc/tests/data/python3/directory/class.py:52||4|function_in_file2|/home/sss/cyclomatic_complexity/pcc/tests/data/python3/directory/file2.py:1||4|ifs_c_func|/home/sss/cyclomatic_complexity/pcc/tests/data/c/ifs.c:1||4|if_c|/home/sss/cyclomatic_complexity/pcc/tests/data/c/directory/if.c:1||3|for_c|/home/sss/cyclomatic_complexity/pcc/tests/data/c/directory/for.c:1||3|if_while_c|/home/sss/cyclomatic_complexity/pcc/tests/data/c/directory/while.c:1||2|if_statment_0|/home/sss/cyclomatic_complexity/pcc/tests/data/python3/ifs.py:2||2|if_statment_1|/home/sss/cyclomatic_complexity/pcc/tests/data/python3/ifs.py:8|Developmentdownload repo and initialize environmentpython3-mvenvvenvsource./venv/bin/activate
pip3install-rrequirements_dev.txt# or use aliyunpip3install-rrequirements_dev.txt-ihttps://mirrors.aliyun.com/pypi/simple/
gitsubmoduleupdate--initcompile dynamic librarymakelibrun testmaketestHow to add new language supportadd tree-sitter-parser project to languages dirbuild new language soadd new dir inpccdir like python.implement node, parser, vistor for new languageadd unit testTodoListadd json output for future analyzeadd macos, windows supportdo more testcomment support,for ignore functionselect language and sort group by languageReferenceCookiecutteraudreyr/cookiecutter-pypackagecyclomatic complexities Wikigocyclotree-sitterpy-tree-sittermccabecccalculatorHistory0.0.1 (2022-09-04)First release on PyPI.0.0.2 (2022-09-05)Add C language support.