gerencianet/gn-api-sdk-python

View on GitHub

Showing 4 of 59 total issues

File constants.py has 395 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# encoding: utf-8


class Constants(object):
    APIS = {
Severity: Minor
Found in gerencianet/constants.py - About 5 hrs to fix

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

        def authenticate(self):
            
            url = self.build_url(self.endpoints['authorize']['route'], {})             
            
            if(self.options['certificate']):
    Severity: Minor
    Found in gerencianet/endpoints.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 send has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def send(self, settings, params, body, headersComplement):
            url = self.build_url(settings['route'], params)
    
            if(self.options['certificate']):
                headers = {
    Severity: Minor
    Found in gerencianet/endpoints.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 remove_placeholders has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def remove_placeholders(self, route, params):
            regex = r'\:(\w+)'
            match = re.findall(regex, route)
            if match:
                for attr in match:
    Severity: Minor
    Found in gerencianet/endpoints.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