Showing 25 of 25 total issues
Function from_velocity
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def from_velocity(cls, velocity):
"""Return a direction which corresponds
to the current 2D velocity.
See Also:
- 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 __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name, surface, tiles, tile_size, animated_tiles=None):
Function palette_cycle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def palette_cycle(surface):
"""get_palette is not sufficient; it generates superflous colors.
Note:
Need to see if I can convert 32bit alpha to 8 bit temporarily,
- 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 runtime_setup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def runtime_setup(self):
"""Perform actions to setup the walkabout. Actions performed
once pygame is running and walkabout has been initialized.
Convert and play all the animations, run init for children.
- 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 from_resource
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def from_resource(self, scene_name):
"""The native format, and hopefully most reliable,
stable, and generally best way of saving, loading,
or creating Hypatia scenes.
- 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"