WenjieDu/PyPOTS

View on GitHub

Showing 398 of 455 total issues

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

    def __init__(
Severity: Major
Found in pypots/clustering/template/model.py - About 1 hr to fix

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

        def __init__(
    Severity: Major
    Found in pypots/imputation/csai/data.py - About 1 hr to fix

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

          def __init__(
      Severity: Major
      Found in pypots/imputation/koopa/core.py - About 1 hr to fix

        Function forward has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def forward(self, q, k, v, mask=None, input_mask=None, attn_bias=None, window_size=None):
        
                mask = default(mask, input_mask)
        
                assert not (
        Severity: Minor
        Found in pypots/nn/modules/reformer/local_attention.py - About 1 hr to fix

          Function __init__ has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def __init__(
                  self,
                  n_out_steps,
                  n_in_steps,
                  n_in_features,
          Severity: Minor
          Found in pypots/nn/modules/scinet/backbone.py - About 1 hr to fix

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

                def __init__(
            Severity: Major
            Found in pypots/nn/modules/etsformer/layers.py - About 1 hr to fix

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

                  def __multi_scale_process_inputs(self, x_enc, x_mark_enc):
                      if self.downsampling_method == "max":
                          down_pool = torch.nn.MaxPool1d(self.downsampling_window, return_indices=False)
                      elif self.downsampling_method == "avg":
                          down_pool = torch.nn.AvgPool1d(self.downsampling_window)
              Severity: Minor
              Found in pypots/nn/modules/timemixer/backbone.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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(
              Severity: Major
              Found in pypots/nn/modules/transformer/autoencoder.py - About 1 hr to fix

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

                    def __init__(
                Severity: Major
                Found in pypots/forecasting/template/model.py - About 1 hr to fix

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

                      def __init__(
                  Severity: Major
                  Found in pypots/nn/modules/koopa/backbone.py - About 1 hr to fix

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

                    def get_mask(input_size, window_size, inner_size):
                        """Get the attention mask of PAM-Naive"""
                        # Get the size of all layers
                        all_size = [input_size]
                        for i in range(len(window_size)):
                    Severity: Minor
                    Found in pypots/nn/modules/pyraformer/layers.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 message has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def message(
                            self,
                            x_i: Tensor,
                            x_j: Tensor,
                            edge_weights: Tensor,
                    Severity: Minor
                    Found in pypots/nn/modules/raindrop/layers.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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(
                    Severity: Major
                    Found in pypots/classification/csai/core.py - About 1 hr to fix

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

                          def __init__(
                      Severity: Major
                      Found in pypots/imputation/template/model.py - About 1 hr to fix

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

                            def __init__(
                        Severity: Major
                        Found in pypots/nn/modules/reformer/lsh_attention.py - About 1 hr to fix

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

                          def clusters_for_plotting(
                              cluster_members: Dict[int, np.ndarray],
                          ) -> Dict[int, dict]:
                              """
                              Organize clustered arrays into format ready for plotting.
                          Severity: Minor
                          Found in pypots/utils/visual/clustering.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 calc_binary_classification_metrics has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def calc_binary_classification_metrics(
                              prob_predictions: np.ndarray,
                              targets: np.ndarray,
                              pos_label: int = 1,
                          ) -> dict:
                          Severity: Minor
                          Found in pypots/utils/metrics/classification.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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def __init__(
                          Severity: Major
                          Found in pypots/classification/csai/data.py - About 1 hr to fix

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

                                def __init__(
                            Severity: Major
                            Found in pypots/nn/modules/saits/backbone.py - About 1 hr to fix

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

                                  def _fetch_data_from_array(self, idx: int) -> Iterable:
                                      """Fetch data according to index.
                              
                                      Parameters
                                      ----------
                              Severity: Minor
                              Found in pypots/imputation/csdi/data.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

                              Severity
                              Category
                              Status
                              Source
                              Language