yzhao062/Pyod

View on GitHub

Showing 77 of 265 total issues

Function _set_small_large_clusters has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _set_small_large_clusters(self, n_samples):
        # Sort the index of clusters by the number of samples belonging to it
        size_clusters = np.bincount(self.cluster_labels_)

        # Sort the order from the largest to the smallest
Severity: Minor
Found in pyod/models/cblof.py - About 55 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 _x2d has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _x2d(self, X):
        """Computes the dissimilarity matrix of a given dataset.
        
        Parameters
        ----------
Severity: Minor
Found in pyod/models/sos.py - About 55 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 __init__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self,
                 n_features,
                 hidden_neurons=(128, 64),
                 dropout_rate=0.2,
                 batch_norm=True,
Severity: Minor
Found in pyod/models/auto_encoder_torch.py - About 55 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 __dis has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def __dis(self, X):
        """
        Internal function to calculate for
        dissimilarity in a sequence of sets.
        """
Severity: Minor
Found in pyod/models/lmdd.py - About 55 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 __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, n_features, n_hidden=[500, 100], n_output=20,
Severity: Major
Found in pyod/models/dif.py - About 50 mins to fix

    Function rod_nD has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def rod_nD(X, parallel, gm=None, median=None, data_scaler=None, angles_scalers1=None, angles_scalers2=None):
    Severity: Major
    Found in pyod/models/rod.py - About 50 mins to fix

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

          def __init__(self, in_channels, out_channels,
      Severity: Minor
      Found in pyod/models/dif.py - About 45 mins to fix

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

            def explain_outlier(self, ind, columns=None, cutoffs=None,
        Severity: Minor
        Found in pyod/models/copod.py - About 45 mins to fix

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

          def _calculate_outlier_scores(X, bin_edges, hist, n_bins, alpha,
          Severity: Minor
          Found in pyod/models/hbos.py - About 45 mins to fix

            Function fit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def fit(self, X, y=None):
                    """Fit detector. y is ignored in unsupervised methods.
            
                    Parameters
                    ----------
            Severity: Minor
            Found in pyod/models/kpca.py - About 45 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 explain_outlier has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def explain_outlier(self, ind, columns=None, cutoffs=None,
            Severity: Minor
            Found in pyod/models/ecod.py - About 45 mins to fix

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

                  def __init__(
              Severity: Minor
              Found in pyod/models/kde.py - About 45 mins to fix

                Function decision_function has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def decision_function(self, X):
                        """Predict raw anomaly score of X using the fitted detector.
                
                        The anomaly score of an input sample is computed based on different
                        detector algorithms. For consistency, outliers are assigned with
                Severity: Minor
                Found in pyod/models/loda.py - About 45 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 check_consistent_shape has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def check_consistent_shape(X_train, y_train, X_test, y_test, y_train_pred,
                Severity: Minor
                Found in pyod/utils/data.py - About 45 mins to fix

                  Function fit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def fit(self, X, y=None):
                          """Fit detector. y is ignored in unsupervised methods.
                  
                          Parameters
                          ----------
                  Severity: Minor
                  Found in pyod/models/sampling.py - About 45 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 fit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def fit(self, X, y=None):
                          """Fit detector. y is ignored in unsupervised methods.
                  
                          Parameters
                          ----------
                  Severity: Minor
                  Found in pyod/models/loda.py - About 45 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_in_out_channels has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def get_in_out_channels(i, num_layers, n_features, n_hidden, n_output,
                  Severity: Minor
                  Found in pyod/models/dif.py - About 35 mins to fix

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

                    def rod_3D(x, gm=None, median=None, scaler1=None, scaler2=None):
                    Severity: Minor
                    Found in pyod/models/rod.py - About 35 mins to fix

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

                      def _get_critical_values(dist_matrix, alpha, p_ix, r_max,
                      Severity: Minor
                      Found in pyod/models/loci.py - About 35 mins to fix

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

                            def __init__(self,
                        Severity: Minor
                        Found in pyod/models/sampling.py - About 35 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language