dave-shawley/glinda

View on GitHub

Showing 4 of 6 total issues

File services.py has 334 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
Classes for testing applications that make asynchronous HTTP requests.

- ``ServiceLayer``: testing fixture that manages request handlers
  that your tests will interact with
Severity: Minor
Found in glinda/testing/services.py - About 4 hrs to fix

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

        def get(self):
            netloc = os.environ['SERVICE_NETLOC']
            client = httpclient.AsyncHTTPClient()
            try:
                yield client.fetch('http://{0}/status'.format(netloc),
    Severity: Minor
    Found in examples/testing.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

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

        def prepare(self):
            super(RFC2295Handler, self).prepare()
            if not self._finished:
                negotiate = headers.parse_list_header(
                    self.request.headers.get('Negotiate', ''))
    Severity: Minor
    Found in examples/contentneg.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

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

    def read_requirements_file(name):
        reqs = []
        try:
            with open(name) as req_file:
                for line in req_file:
    Severity: Minor
    Found in setup.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