WenjieDu/PyPOTS

View on GitHub

Showing 455 of 455 total issues

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

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

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

    def _BTTF(
        dense_tensor,
        sparse_tensor,
        init,
        rank,
    Severity: Minor
    Found in pypots/forecasting/bttf/core.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, in_planes, kernel_size, 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/imputeformer/attention.py - About 45 mins to fix

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

            def forward(self, qk, v, query_len=None, input_mask=None, input_attn_mask=None, **kwargs):
        Severity: Minor
        Found in pypots/nn/modules/reformer/lsh_attention.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/tide/autoencoder.py - About 45 mins to fix

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

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

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

                  def __init__(self, self_attention, cross_attention, seg_len, d_model, d_ff=None, dropout=0.1):
              Severity: Minor
              Found in pypots/nn/modules/crossformer/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/cli/tuning.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/frets/backbone.py - About 45 mins to fix

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

                        def forward(
                            self,
                            x: Union[Tensor, PairTensor],
                            p_t: Tensor,
                            edge_index: Adj,
                    Severity: Minor
                    Found in pypots/nn/modules/raindrop/layers.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__(
                    Severity: Minor
                    Found in pypots/cli/dev.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if hasattr(value, "__iter__"):
                                                  value = [datetime.fromtimestamp(ts) for ts in value]
                                              else:
                                                  value = datetime.fromtimestamp(value)
                                      datadict[key] = value
                      Severity: Major
                      Found in pypots/data/saving/h5.py - About 45 mins to fix

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

                                def wrapper(self, *args, key_namespace=None, fetch=False, set_cache=True, **kwargs):
                        Severity: Minor
                        Found in pypots/nn/modules/reformer/lsh_attention.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/nonstationary_transformer/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/classification/brits/core.py - About 45 mins to fix

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

                                  def _get_data_sizes(self) -> Tuple[int, ...]:
                                      """Detect the data sample sizes in the dataset and return the numbers.
                              
                                      Returns
                                      -------
                              Severity: Minor
                              Found in pypots/data/dataset/base.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__(
                              Severity: Minor
                              Found in pypots/imputation/usgan/core.py - About 45 mins to fix

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

                                        real = ffted[..., 0].permute(0, 2, 1, 3).contiguous().reshape(batch_size, node_cnt, -1)
                                Severity: Minor
                                Found in pypots/nn/modules/stemgnn/layers.py and 1 other location - About 45 mins to fix
                                pypots/nn/modules/stemgnn/layers.py on lines 78..78

                                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 35.

                                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

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

                                        img = ffted[..., 1].permute(0, 2, 1, 3).contiguous().reshape(batch_size, node_cnt, -1)
                                Severity: Minor
                                Found in pypots/nn/modules/stemgnn/layers.py and 1 other location - About 45 mins to fix
                                pypots/nn/modules/stemgnn/layers.py on lines 77..77

                                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 35.

                                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

                                Severity
                                Category
                                Status
                                Source
                                Language