bmewing/mlpce

View on GitHub

Showing 2 of 2 total issues

Function _auto_model has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _auto_model(self, df):
        linearterms = [x for x in df.columns.to_list() if x not in self.responses]
        linear, two_fi, x2, three_fi, x3 = self._check_degrees_of_freedom(df.shape)
        grid2 = np.meshgrid(linearterms, linearterms, indexing='ij')
        grid3 = np.meshgrid(linearterms, linearterms, linearterms, indexing='ij')
Severity: Minor
Found in mlpce/Confidence.py - About 35 mins to fix

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 gen_xpxi has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def gen_xpxi(self, known=None, responses=None):
        """
        Calculate the 'X-prime, X, inverse' matrix for each response and the full dataset
        :param known: pandas DataFrame of points with gathered data.
        :param responses: OPTIONAL list of column names in known corresponding to response variables
Severity: Minor
Found in mlpce/Confidence.py - About 35 mins to fix

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

Severity
Category
Status
Source
Language