EventGhost/EventGhost

View on GitHub
_build/builder/CheckDependencies.py

Summary

Maintainability
D
1 day
Test Coverage

File CheckDependencies.py has 407 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
Severity: Minor
Found in _build/builder/CheckDependencies.py - About 5 hrs to fix

    Function CheckDependencies has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
    Open

    def CheckDependencies(buildSetup):
        failedDeps = []
    
        for dep in DEPENDENCIES:
            dep.buildSetup = buildSetup
    Severity: Minor
    Found in _build/builder/CheckDependencies.py - About 5 hrs 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 InstallDependency has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def InstallDependency(dep):
        if dep.name == "Stackless Python":
            return dep.Check()
        elif not dep.url and not dep.package:
            package = dep.name + ("==" + dep.version if dep.exact else "")
    Severity: Minor
    Found in _build/builder/CheckDependencies.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 Check has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def Check(self):
            try:
                with warnings.catch_warnings():
                    warnings.simplefilter("ignore")
                    module = __import__(self.module)
    Severity: Minor
    Found in _build/builder/CheckDependencies.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 Check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def Check(self):
            with open(join(self.buildSetup.pyVersionDir, "Manifest.xml")) as f:
                manifest = f.read()
            match = re.search(
                'name="(?P<name>.+\.CRT)"\n'
    Severity: Minor
    Found in _build/builder/CheckDependencies.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

    There are no issues that match your filters.

    Category
    Status