Showing 188 of 188 total issues
Function _shade
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _shade(self, scene: Scene, ray: Ray, hitrecord: HitRecord) -> tuple:
r = g = b = 0 # background color
hit = False
for element in scene.nodes:
if element.hit(ray, hitrecord):
- 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 __getitem__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __getitem__(self, key):
if type(key) == tuple:
if len(key) != 2:
raise IndexError("Index must be 2-dimensional!")
x, y = 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"
Further reading
Function snowflake
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def snowflake(image: Image, lev: int, x1: int, y1: int, x5: int, y5: int, color: Vec3) -> None:
if lev == 0:
image.drawLine(Vec2(x1, y1), Vec2(x5, y5), color)
else:
deltaX = x5 - x1
- 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
TODO found Open
self.invdir = Vec3(1e20, 1e20, 1e20) # TODO: make this IEEE 754 compliant
- Exclude checks
TODO found Open
def hitShadow(self, ray: Ray) -> bool: # TODO: This method should be renamed to "hitTest".
- Exclude checks
TODO found Open
# TODO: MATERIAL
- Exclude checks
TODO found Open
# TODO: use arbitrary size, currently only size 1,2 and 3 are supported...
- Exclude checks
TODO found Open
if type(kwargs["normal"]) == Vec3: # TODO: a list/tuple of values is ok too...
- Exclude checks