Sbozzolo / kuibit

Function with cyclomatic complexity higher than threshold PY-R1000
Anti-pattern
Minor
7 occurrences in this check
preprocess_plot_grid has a cyclomatic complexity of 20 with "high" risk
 171    return inner
 172
 173
 174def preprocess_plot_grid(func): 175    """Decorator to set-up plot functions that plot grid data.
 176
 177    This decorator extends :py:func:`~.preprocess_plot` for specific functions.
mismatch_from_strains has a cyclomatic complexity of 16 with "high" risk
 198    return (np.amax(overlaps), overlaps.argmax())
 199
 200
 201def mismatch_from_strains( 202    h1,
 203    h2,
 204    fmin=0,
HierarchicalGridData._compute_component_mapping has a cyclomatic complexity of 17 with "high" risk
2193        # All integers and constant
2194        return True
2195
2196    def _compute_component_mapping(self):2197        """Scan the grid structure and prepare a map between points and components.
2198
2199        :returns: Function that maps a point to the UniformGridData at highest
UniformGridData.sliced has a cyclomatic complexity of 22 with "high" risk
 684        # data is available. This is probably inefficient.
 685        return self.evaluate_with_spline(x)
 686
 687    def sliced(self, cut, resample=False): 688        """Return a new :py:class:`~.UniformGridData` obtained slicing the current one.
 689
 690        ``cut`` specifies how to slice the data. It has to be an array with the
OneHorizon.shape_outline_at_iteration has a cyclomatic complexity of 20 with "high" risk
 683        }
 684        return patches, origin
 685
 686    def shape_outline_at_iteration(self, iteration, cut): 687        """Return the cut of the 3D shape on a specified plane.
 688
 689        ``cut`` has to be a 3D tuple or list with None on the dimensions you
OneHorizon._load_patches has a cyclomatic complexity of 16 with "high" risk
 577        return self._iterations_to_times(iteration)
 578
 579    @staticmethod
 580    def _load_patches(path): 581        """AHFinderDirect uses a system of multipatches to avoid coordinates
 582        singularities. Each patch covers a portion around an axis (e.g., +z
 583        axis). We will load this data.
AllGridFunctions.__init__ has a cyclomatic complexity of 17 with "high" risk
1527    # The oddball case is with OpenPMD files. OpenPMD files are actually folders
1528    # with extension .bp4 and they are always 3D.
1529
1530    def __init__(self, allfiles, dimension, num_ghost=None):1531        """Constructor.
1532
1533        :param allfiles: List of all the files.