File __init__.py
has 443 lines of code (exceeds 250 allowed). Consider refactoring. Open
class BaseFormat:
begin_block = '{\n'
end_block = '}\n\n'
def format_item(self, name, item, indent: int = 1):
Function add_str_tags
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def add_str_tags(self):
the_str = '\ttags {\n'
tags = self.tags
if type(tags) == list:
for tag in self.tags:
- Read upRead up
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 __str__
has 26 lines of code (exceeds 25 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)
Function __str__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __str__(self):
the_str = ''
if not self.inserted:
the_str += super(Route, self).__str__()
the_str += '\n\troute {\n'
- Read upRead up
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 __str__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __str__(self):
if any('Name' in d['Key'] for d in self.tags):
for tag in self.tags:
if tag['Key'] == 'Name' and tag['Value'] not in self.name:
self.name = self.name + '-' + tag['Value']
- Read upRead up
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 __str__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __str__(self):
if any('Name' in d['Key'] for d in self.tags):
for tag in self.tags:
if tag['Key'] == 'Name':
self.name = self.name + '-' + tag['Value']
- Read upRead up
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 __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)
- Read upRead up
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"