OCA / interface-github

Tools to interact with github from Odoo
GNU Affero General Public License v3.0
46 stars 77 forks source link

[15.0][WIP] github_connector: Change pygount to cloc #107

Closed victoralmau closed 10 months ago

victoralmau commented 1 year ago

Changes done:

Change pygount to cloc (https://github.com/AlDanial/cloc)

Previously with pygount the parsing time of an OCA/account-analytic/15.0 repository was very slow (11.33s), now with cloc the time is 1.60s.

pygount: tiempo-pygount

cloc: tiempo-cloc

The analysis of pygount vs cloc is similar (cloc being more accurate in my opinion). Analyzed example file: https://github.com/OCA/account-analytic/blob/15.0/account_analytic_parent/models/account_analytic_account.py

pygount data

SourceAnalysis(
        path='OCA/account-analytic/15.0/account_analytic_parent/models/account_analytic_account.py', 
        language='Python', 
        group='', 
        state=analyzed, 
        code_count=106, 
        documentation_count=13, 
        empty_count=32, 
        string_count=0
    )

cloc data

{
    "nFiles": 1,
    "blank": 17,
    "comment": 13,
    "code": 121
}

The code has been refactored a bit to simplify it, comment it and make that only one call to the cloc command is needed to analyze everything in the repository and then with that result define the values according to the defined rules.

@Tecnativa TT25583

OCA-git-bot commented 10 months ago

On my way to merge this fine PR! Prepared branch 15.0-ocabot-merge-pr-107-by-pedrobaeza-bump-major, awaiting test results.

OCA-git-bot commented 10 months ago

Congratulations, your PR was merged at b68c2feb1f1b8d2d085ccee3c2baacc5868e2684. Thanks a lot for contributing to OCA. ❤️