alainivars/utils2devops

View on GitHub

Showing 24 of 34 total issues

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

    def __str__(self):
        the_str = super(Lambda, self).__str__()
        the_str += self.format_item_cond('filename', self.ofilename)
        the_str += self.format_item_cond('s3_bucket', self.os3_bucket)
        the_str += self.format_item_cond('s3_key', self.os3_key)
Severity: Minor
Found in utils2devops/aws/__init__.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 status_controller has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def status_controller(self):
        for container in self.client.containers.all():
            if Container.is_controller(container):
                to_print = self.base_line(container)
                if self.VERBOSE:
Severity: Minor
Found in utils2devops/lxd_lxc/container.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 list_s3_bucket has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def list_s3_bucket(
        profile_name: str = 'terraform',
        region_name: str = 'us-east-1'
) -> [str]:
    """This function list all AWS S3 bucket how can access the profile
Severity: Minor
Found in utils2devops/aws/s3_bucket.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 get_aws_secret has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def get_aws_secret(region_name, secret_name):
    """
    Get Aws secret
    :param region_name:
    :param secret_name:
Severity: Minor
Found in utils2devops/aws/secretmanager.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