KNODIS-Research-Group/manifoldy

View on GitHub

Showing 12 of 12 total issues

File L2NormCurvature.py has 500 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
# coding: utf-8

import copy
import datetime
Severity: Minor
Found in manifoldy/L2NormCurvature.py - About 1 day to fix

    Function L2_norm_sectional_curvature has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def L2_norm_sectional_curvature(
    Severity: Major
    Found in manifoldy/L2NormCurvature.py - About 1 hr to fix

      Function compute_curvature_tensor has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def compute_curvature_tensor(g, dg, ddg):
          # Index 0: Upper index
          # Index 1, 2, 3: Lower indices
          # R[l,i,j,k] = R^l_{ijk} = dx^l(R(ei,ej)ek)
          n = g.shape[0]
      Severity: Minor
      Found in manifoldy/L2NormCurvature.py - About 1 hr 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 create_curve has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def create_curve(
      Severity: Minor
      Found in manifoldy/generators.py - About 45 mins to fix

        Function get_curvature_function has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def get_curvature_function(curvature_types, args, n, t_min=-1, t_max=1, t_step=0.01):
        Severity: Minor
        Found in manifoldy/generators.py - About 45 mins to fix

          Function compute_knn_point_derivatives has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def compute_knn_point_derivatives(X, Y, i, n_neighbors, distance_matrix):
          Severity: Minor
          Found in manifoldy/L2NormCurvature.py - About 35 mins to fix

            Function compute_grid_norm has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def compute_grid_norm(X, R_sq, grid_n_samples, offset=2, verbose=False):
            Severity: Minor
            Found in manifoldy/L2NormCurvature.py - About 35 mins to fix

              Function estimate_sectional_curvature has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def estimate_sectional_curvature(
              Severity: Minor
              Found in manifoldy/L2NormCurvature.py - About 35 mins to fix

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

                def get_riemannian_metric(X, Y, n_neighbors, distance_matrix):
                    g = []
                    dim = X.shape[1]
                    for i in range(X.shape[0]):
                        stop = False
                Severity: Minor
                Found in manifoldy/L2NormCurvature.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 get_partial_derivative_indices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def get_partial_derivative_indices(variables, order=2):
                    """
                    Gets indices for partial derivatives w.r.t each variable.
                    :param variables: number of variables (number of partial derivatives per order)
                    :param order: max. order of derivation.
                Severity: Minor
                Found in manifoldy/L2NormCurvature.py - About 25 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 compute_first_christoffel_symbols has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def compute_first_christoffel_symbols(dg, n):
                    CS_first = np.zeros((n, n, n))
                    for i in range(n):
                        for j in range(n):
                            for k in range(n):
                Severity: Minor
                Found in manifoldy/L2NormCurvature.py - About 25 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 compute_partial_derivative_first_christoffel_symbols has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def compute_partial_derivative_first_christoffel_symbols(ddg, l, n):
                    CS_first_diff = np.zeros((n, n, n))
                    for i in range(n):
                        for j in range(n):
                            for k in range(n):
                Severity: Minor
                Found in manifoldy/L2NormCurvature.py - About 25 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