Showing 54 of 127 total issues
Function quality
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def quality(self, method="MSSSIM", L=1.0, **kwargs):
"""Compute the full-reference image quality of each image pair.
Available methods include SSIM :cite:`wang:02`, MSSSIM :cite:`wang:03`,
VIFp :cite:`Sheikh:15`
- 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 ssim
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ssim(
img1,
img2,
sigma=1.2,
L=1,
Function __init__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
steps=10,
jitter=True,
geometry=Square(center=Point([0.5, 0.5]), side_length=1)
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, n_sizes=5, size_ratio=0.5, n_shuffles=5):
"""
Parameters
----------
n_sizes : int
- 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
Avoid deeply nested control flow statements. Open
if self.contains(other.center):
for edge in self.edges:
if other.center.distance(edge) < other.radius:
return False
return True
Avoid deeply nested control flow statements. Open
if self.contains(other.center):
for edge in self.edges:
if other.center.distance(edge) < other.radius:
return False
return True and not other.contains(-self)
Function _get_attenuation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _get_attenuation(self, phantom):
"""Return the beam intensity attenuation due to the phantom."""
intersection = beamintersect(self, phantom.geometry)
if intersection is None or phantom.material is None:
- 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 get_pie_glyphs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_pie_glyphs(xy, values, color='coverage', trace_normal=1, **kwargs):
"""Returns a list of pie glyphs at coordinates xy representing values
The areas of the pie sectors are proportional to the elements of the
vector that the glyph represents. The default color of the
- 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
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return (
Avoid too many return
statements within this function. Open
return True and not other.contains(-self)
Avoid too many return
statements within this function. Open
return border.contains_points(np.atleast_2d(x))
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return (
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return np.all(self.contains(x))
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return (