Showing 17 of 25 total issues
File animatedsprite.py
has 536 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Quite specifically my pyganim replacement.
More advanced animation/sprite abstractions are in
the animations module.
File game.py
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
# This module is part of Hypatia and is released under the
# MIT License: http://opensource.org/licenses/MIT
"""Why stuff is drawn; logic flow for the game.
File tiles.py
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
# This module is part of Hypatia and is released under the
# MIT License: http://opensource.org/licenses/MIT
"""Where stuff is being drawn; tile engine for maps.
Function __init__
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, tilesheet_name, tile_ids):
"""Stitch tiles from swatch to layer surfaces.
Piece together layers/surfaces from corresponding tile graphic
names, using the specified tile swatch. Keep track of
- 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
File sprites.py
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
# This module is part of Hypatia and is released under the
# MIT license: http://opensource.org/licenses/MIT
"""Sprites!
Function __init__
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, directory, position=None, children=None):
"""
Args:
directory (str): directory containing (animated)
- 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 handle_input
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def handle_input(self):
"""For the "overworld," a generic scene where
the player moves about the scene.
This is in its infancy.
- 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 a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, resource_category, resource_name):
"""Load a resource ZIP using a category and zip name.
Args:
resource_category (str): E.g., tilesheets, walkabouts.
- 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 move
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def move(self, game, direction):
"""Modify human player's positional data legally (check
for collisions).
Note:
Will round down to nearest probable step
- 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 a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, path_or_readable):
"""Read XML from path_or_readable, validate the TMX as being
supported by Hypatia, and set all supported information as
attributes.
- 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 talk
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def talk(self, npcs, dialogbox):
"""Trigger another actor's :meth:`actor.Actor.say()` if
they are immediately *in front* of this actor.
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 from_resources
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def from_resources(cls, tilesheet_name):
"""Create a Tilesheet from a name, corresponding to a path
pointing to a tilesheet zip archive.
Args:
- 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_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 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"
Further reading
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"