shiwaforce/poco

View on GitHub
poco/services/catalog_handler.py

Summary

Maintainability
A
2 hrs
Test Coverage
C
79%

Function check_and_print_project has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def check_and_print_project(lst):
        for cat in lst.keys():
            for key in lst[cat].keys():
                msg = key
                if os.path.exists(os.path.join(
Severity: Minor
Found in poco/services/catalog_handler.py - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function print_ls has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def print_ls():
        """Get catalog list"""
        if StateHolder.name is not None:
            lst = dict()
            lst[StateHolder.name] = StateHolder.catalogs[StateHolder.name]
Severity: Minor
Found in poco/services/catalog_handler.py - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function parse_catalog has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_catalog():
        """Parse catalog file"""
        StateHolder.catalogs = dict()

        for key in StateHolder.catalog_repositories.keys():
Severity: Minor
Found in poco/services/catalog_handler.py - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function get_repo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def get_repo(key, repo, silent):
        conf = StateHolder.config[key]
        if 'git' == repo:
            repository = GitRepository(target_dir=os.path.join(StateHolder.home_dir, 'catalogHome', key),
                                       url=CatalogHandler.get_url(conf),
Severity: Minor
Found in poco/services/catalog_handler.py - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

There are no issues that match your filters.

Category
Status