dvershinin / lastversion

Function with cyclomatic complexity higher than threshold PY-R1000
Anti-pattern
Minor
4 months ago8 months old
GitHubRepoSession.find_in_tags_via_graphql has a cyclomatic complexity of 17 with "high" risk
264            return r.json()
265        return None
266
267    def find_in_tags_via_graphql(self, ret, pre_ok, major):268        """GraphQL allows for faster search across many tags.
269        We aggregate the highest semantic version among batches of 100 records.
270        In this way --major filtering results in much fewer requests compared to traditional API
GitHubRepoSession.get_release_from_feed has a cyclomatic complexity of 19 with "high" risk
519            release["install_name"] = self.name
520        return release or None
521
522    def get_release_from_feed(self, pre_ok, major):523        """Get the latest release from the `releases.atom` feed."""
524        ret = {}
525        seen_semver = False
BaseProjectHolder.sanitize_version has a cyclomatic complexity of 22 with "high" risk
292            return True
293        return False
294
295    def sanitize_version(self, version_s, pre_ok=False, major=None):296        """
297        Extract a version from tag name; that satisfies this holder's filters, etc.
298
main has a cyclomatic complexity of 52 with "critical" risk
549    sys.exit(1)
550
551
552def main(argv=None):553    """
554    The entrypoint to CLI app.
555
update_spec has a cyclomatic complexity of 21 with "high" risk
377    return None
378
379
380def update_spec(repo, res, sem="minor"):381    print(res["version"])
382    if "current_version" not in res or res["current_version"] < res["version"]:
383        log.info("Updating spec %s with semantic %s", repo, sem)