rorymurdock/WSO-UEM-Py

View on GitHub

Showing 8 of 23 total issues

Function create_og has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def create_og(self,
                  parentog_id: int,
                  payload=dict,
                  strict_name=True,
                  strict_group_id=True):
Severity: Minor
Found in wso/wso.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 get_user has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def get_user(self,
Severity: Major
Found in wso/wso.py - About 1 hr to fix

    Function find_admin has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def find_admin(self,
    Severity: Major
    Found in wso/wso.py - About 1 hr to fix

      Function format_og_payload has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def format_og_payload(self,
      Severity: Major
      Found in wso/wso.py - About 1 hr to fix

        Function format_og_payload has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def format_og_payload(self,
                                  name: str,
                                  group_id: str,
                                  location_group_type,
                                  country=None,
        Severity: Minor
        Found in wso/wso.py - About 55 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_user has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_user(self,
                         firstname=None,
                         lastname=None,
                         email=None,
                         locationgroupId=None,
        Severity: Minor
        Found in wso/wso.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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def __init__(self,
                         config_dir="config",
                         config_file="uem.json",
                         debug=False,
                         bulk_query_trigger=50):
        Severity: Minor
        Found in wso/wso.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 check_key has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def check_key(self, t_key, value, file):
                """A varible function to check the keys of a json for a value"""
                with open("wso/system_parameters/" + CONFIG_FILES[file]) as json_file:
                    keys = json.load(json_file)
        
        
        Severity: Minor
        Found in wso/utilities.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