w4k2/stream-learn

View on GitHub

Showing 40 of 131 total issues

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

    def __init__(
Severity: Major
Found in strlearn/streams/SemiSyntheticStreamGenerator.py - About 1 hr to fix

    Function _make_stream has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def _make_stream(self):
            np.random.seed(self.random_state)
            
            # Optionally binarize the data
            if self.binarize:
    Severity: Minor
    Found in strlearn/streams/SemiSyntheticStreamGenerator.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 feed has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def feed(self, X, real, pred):
    
            if len(pred) != len(real):
                self.drift.append(0)
                self._is_drift = False
    Severity: Minor
    Found in strlearn/detectors/DDM.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 _make_stream has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def _make_stream(self):
            np.random.seed(self.random_state)
            
            # Optionally binarize the data
            if self.binarize:
    Severity: Minor
    Found in strlearn/streams/SemiSyntheticStreamGenerator.py - About 1 hr to fix

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

          def __init__(
      Severity: Major
      Found in strlearn/ensembles/WAE.py - About 1 hr to fix

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

            def feed(self, X, y, pred):
        
                if not hasattr(self, "mu_W"):
                    self.W = np.copy(X)
                    self.Wy = np.copy(y)
        Severity: Minor
        Found in strlearn/ensembles/ROSE.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 feed has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def feed(self, X, y, pred):
        
                if not hasattr(self, "mu_W"):
                    self.W = np.copy(X)
                    self.Wy = np.copy(y)
        Severity: Minor
        Found in strlearn/detectors/ADWIN.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 partial_fit has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def partial_fit(self, X, y, classes=None):
                """Partial fitting."""
                X, y = check_X_y(X, y)
        
                if not hasattr(self, "ensemble_"):
        Severity: Minor
        Found in strlearn/ensembles/OUSE.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 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, sigma=3, immobilizer=5, n_detectors=15, subspace_size=1, random_state=None, sensitivity=0.55):
        Severity: Minor
        Found in strlearn/detectors/SDDE.py - About 45 mins to fix

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

              def __init__(self,
          Severity: Minor
          Found in strlearn/ensembles/REA.py - About 45 mins to fix

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

                def partial_fit(self, X, y, classes=None):
                    super().partial_fit(X, y, classes)
                    if not self.green_light:
                        return self
            
            
            Severity: Minor
            Found in strlearn/ensembles/AUE.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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, base_estimator=None,
            Severity: Minor
            Found in strlearn/ensembles/ROSE.py - About 45 mins to fix

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

                  def __init__(self, base_estimator=None, beta=.5, theta=.01, p = 1, weighted=False):
              Severity: Minor
              Found in strlearn/ensembles/DWM.py - About 35 mins to fix

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

                    def partial_fit(self, X, y, classes=None):
                        super().partial_fit(X, y, classes)
                        if not self.green_light:
                            return self
                
                
                Severity: Minor
                Found in strlearn/ensembles/REA.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 _sigmoid has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _sigmoid(self, sigmoid_spacing, n_drifts):
                        period = (
                            int((self.n_samples) / (n_drifts)) if n_drifts > 0 else int(self.n_samples)
                        )
                        css = sigmoid_spacing if sigmoid_spacing is not None else 9999
                Severity: Minor
                Found in strlearn/streams/StreamGenerator.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 partial_fit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def partial_fit(self, X, y, classes=None):
                        """Partial fitting"""
                        X, y = check_X_y(X, y)
                        if not hasattr(self, "ensemble_"):
                            self.ensemble_ = []
                Severity: Minor
                Found in strlearn/ensembles/base.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

                Avoid too many return statements within this function.
                Open

                            return "%s_%s_css%i_rs%i_nd%i_ln%i_dd%s_%i" % (
                Severity: Major
                Found in strlearn/streams/StreamGenerator.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return "%s_%s_css%i_rs%i_nd%i_ln%i_%i_dd%s_%i" % (
                  Severity: Major
                  Found in strlearn/streams/StreamGenerator.py - About 30 mins to fix

                    Function partial_fit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def partial_fit(self, X, y, classes=None):
                            # Initialization
                            super().partial_fit(X, y, classes)
                            if not self.green_light:
                                return self
                    Severity: Minor
                    Found in strlearn/ensembles/WAE.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 _set_weights has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _set_weights(self):
                            if self.age_ > 0:
                                if self.weight_calculation_method == "same_for_each":
                                    self.weights_ = np.ones(len(self.ensemble_))
                    
                    
                    Severity: Minor
                    Found in strlearn/ensembles/WAE.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