WenjieDu/PyPOTS

View on GitHub

Showing 455 of 455 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            z_rec = torch.cat((z[:, :1], torch.bmm(x, self.K)), dim=1)
Severity: Minor
Found in pypots/nn/modules/koopa/layers.py and 1 other location - About 50 mins to fix
pypots/nn/modules/koopa/layers.py on lines 148..148

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        z_rec = torch.cat((z[:, :1], torch.bmm(x, self.K)), dim=1)  # B L E
Severity: Minor
Found in pypots/nn/modules/koopa/layers.py and 1 other location - About 50 mins to fix
pypots/nn/modules/koopa/layers.py on lines 106..106

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 4 locations. Consider refactoring.
Open

                self.GLUs.append(
                    GLU(
                        self.time_step * self.output_channel,
                        self.time_step * self.output_channel,
Severity: Major
Found in pypots/nn/modules/stemgnn/layers.py and 3 other locations - About 50 mins to fix
pypots/nn/modules/stemgnn/layers.py on lines 46..49
pypots/nn/modules/stemgnn/layers.py on lines 59..62
pypots/nn/modules/stemgnn/layers.py on lines 65..68

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    def calc_loss(self, observed_data, cond_mask, indicating_mask, side_info, is_train, set_t=-1):
Severity: Minor
Found in pypots/nn/modules/csdi/backbone.py - About 45 mins to fix

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

        def __init__(
    Severity: Minor
    Found in pypots/nn/modules/informer/layers.py - About 45 mins to fix

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

      def sample_factor_v(tau_sparse_tensor, tau_ind, U, V, X, beta0=1):
      Severity: Minor
      Found in pypots/forecasting/bttf/submodules.py - About 45 mins to fix

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

            def __init__(
        Severity: Minor
        Found in pypots/nn/modules/crli/backbone.py - About 45 mins to fix

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

              def __init__(self, B, H, L, index, scores, device="cpu"):
          Severity: Minor
          Found in pypots/nn/modules/informer/layers.py - About 45 mins to fix

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

                def __init__(
            Severity: Minor
            Found in pypots/optim/adamw.py - About 45 mins to fix

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

                  def __init__(self, seq_len, pred_len, top_k, d_model, d_ffn, num_kernels):
              Severity: Minor
              Found in pypots/nn/modules/timesnet/layers.py - About 45 mins to fix

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

                    def __init__(self, k, alpha, c=1, nl=1, initializer=None, **kwargs):
                Severity: Minor
                Found in pypots/nn/modules/fedformer/layers.py - About 45 mins to fix

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

                      def __init__(
                  Severity: Minor
                  Found in pypots/optim/adam.py - About 45 mins to fix

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

                        def _update_context(self, context_in, V, scores, index, L_Q, attn_mask):
                    Severity: Minor
                    Found in pypots/nn/modules/informer/layers.py - About 45 mins to fix

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

                      def sample_factor_u(tau_sparse_tensor, tau_ind, U, V, X, beta0=1):
                      Severity: Minor
                      Found in pypots/forecasting/bttf/submodules.py - About 45 mins to fix

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

                            def forward(self, x, cross, x_mask=None, cross_mask=None, tau=None, delta=None):
                        Severity: Minor
                        Found in pypots/nn/modules/informer/layers.py - About 45 mins to fix

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

                              def __init__(
                          Severity: Minor
                          Found in pypots/optim/sgd.py - About 45 mins to fix

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

                                def __init__(
                            Severity: Minor
                            Found in pypots/nn/modules/patchtst/layers.py - About 45 mins to fix

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

                                  def __init__(
                              Severity: Minor
                              Found in pypots/nn/modules/usgan/backbone.py - About 45 mins to fix

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

                                    def __init__(self, in_planes, kernel, dropout, groups, hidden_size, INN):
                                Severity: Minor
                                Found in pypots/nn/modules/scinet/layers.py - About 45 mins to fix

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

                                      def __init__(
                                  Severity: Minor
                                  Found in pypots/nn/modules/micn/layers.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language