ammarnajjar/pautomate

View on GitHub

Showing 3 of 3 total issues

Function get_branches has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def get_branches(
        working_directory: str,
        reset_mode: bool,
        develop: bool,
        args: Optional[List[str]],
Severity: Minor
Found in pautomate/git_repos/branches.py - About 45 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_repos_from_gitlab has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def get_repos_from_gitlab(working_directoy: str, args: Optional[List[str]]) -> List[str]:
    configs = read_configs(working_directoy)
    gitlab_url = configs.get('gitlab_url')
    gitlab_token = configs.get('gitlab_token')
    gitlab_group_ids = configs.get('gitlab_group_ids')
Severity: Minor
Found in pautomate/git_repos/fetch_gitlab.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 fetch_repo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def fetch_repo(
    working_directory: str,
    repo_path: str,
    url: str,
    summery_info: Dict[str, str],
Severity: Minor
Found in pautomate/common/git.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

Severity
Category
Status
Source
Language