WenjieDu/PyPOTS

View on GitHub

Showing 455 of 455 total issues

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          def __init__(
                              self,
                              in_channels,
                              out_channels,
                              seq_len_q,
                      Severity: Minor
                      Found in pypots/nn/modules/fedformer/layers.py - About 1 hr to fix

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

                            def forward(self, x):
                                mapped = self.net(x)
                                batch_size = mapped.size(0)
                                time_length = mapped.size(1)
                        
                        
                        Severity: Minor
                        Found in pypots/nn/modules/gpvae/layers.py - About 1 hr to fix

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

                              def __init__(
                                  self,
                                  n_features,
                                  n_layers,
                                  d_model,
                          Severity: Minor
                          Found in pypots/nn/modules/raindrop/backbone.py - About 1 hr to fix

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

                                def forward(self, x):
                                    x = x.unsqueeze(-2)
                            
                                    for i in range(self.num_stage):
                                        B, M, D, N = x.shape
                            Severity: Minor
                            Found in pypots/nn/modules/moderntcn/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 future_multi_mixing has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def future_multi_mixing(self, B, enc_out_list, x_list):
                                    dec_out_list = []
                                    if self.channel_independence == 1:
                                        x_list = x_list[0]
                                        for i, enc_out in zip(range(len(x_list)), enc_out_list):
                            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_prior has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def _init_prior(self, device="cpu"):
                                    # Compute kernel matrices for each latent dimension
                                    kernel_matrices = []
                                    for i in range(self.kernel_scales):
                                        if self.kernel == "rbf":
                            Severity: Minor
                            Found in pypots/nn/modules/gpvae/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 save_dict_into_h5 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def save_dict_into_h5(
                                data_dict: dict,
                                saving_path: str,
                                file_name: Optional[str] = None,
                            ) -> None:
                            Severity: Minor
                            Found in pypots/data/saving/h5.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 run has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def run(self):
                                    """Execute the given command."""
                                    # run checks first
                                    self.checkup()
                            
                            
                            Severity: Minor
                            Found in pypots/cli/env.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 _check_array_input has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def _check_array_input(
                                    X: Union[np.ndarray, torch.Tensor],
                                    X_ori: Optional[Union[np.ndarray, torch.Tensor]] = None,
                                    X_pred: Optional[Union[np.ndarray, torch.Tensor]] = None,
                                    y: Optional[Union[np.ndarray, torch.Tensor]] = None,
                            Severity: Minor
                            Found in pypots/data/dataset/base.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 turn_data_into_specified_dtype has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def turn_data_into_specified_dtype(
                                data: Union[np.ndarray, torch.Tensor, list],
                                dtype: str = "tensor",
                            ) -> Union[np.ndarray, torch.Tensor]:
                                """Turn the given data into the specified data type."""
                            Severity: Minor
                            Found in pypots/data/utils.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