Showing 14 of 24 total issues
Function calculate_euclidicity
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def calculate_euclidicity(
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function setup
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup():
"""Perform logging and argument parsing setup.
Sets up the command-line interface for subsequent usage so that we
do not clutter up the actual Euclidicity calculations.
Function sample_from_constant_curvature_annulus
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def sample_from_constant_curvature_annulus(n, K, r, R, seed=None, **kwargs):
Function sample_from_annulus
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def sample_from_annulus(n, r, R, d=2, seed=None):
"""Sample points from an annulus.
This function samples `N` points from an annulus with inner radius `r`
and outer radius `R`.
- 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 sample_from_annulus
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def sample_from_annulus(n, r, R, d=2, seed=None):
Function sample_from_wedged_sphere_varying_dim
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def sample_from_wedged_sphere_varying_dim(n=100, d1=1, d2=2, r=1, noise=None):
Function sample_from_wedged_spheres
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def sample_from_wedged_spheres(n=100, d=2, r=1, noise=None, seed=None):
Function sample_from_sphere
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def sample_from_sphere(n=100, d=2, r=1, noise=None, seed=None):
Function _calculate_euclidicity
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _calculate_euclidicity(self, r, s, X, x, d):
Function linkcode_resolve
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def linkcode_resolve(domain, info):
# Let's frown on global imports and do everything locally as much as
# we can.
import sys
import tardis
- 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 _calculate_euclidicity
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _calculate_euclidicity(self, r, s, X, x, d):
if self.tree is not None:
inner_indices = self.tree.query_radius(x.reshape(1, -1), r)[0]
outer_indices = self.tree.query_radius(x.reshape(1, -1), s)[0]
- 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 __call__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, X, x, **kwargs):
"""Calculate Euclidicity of a specific point.
Parameters
----------
- 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 load_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_data(filename, batch_size, n_query_points, seed=None):
"""Load data from filename, depending on input type.
Parameters
----------
- 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"