WenjieDu/PyPOTS

View on GitHub
pypots/nn/modules/raindrop/layers.py

Summary

Maintainability
C
1 day
Test Coverage

File layers.py has 266 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""

"""

# Created by Wenjie Du <wenjay.du@gmail.com>
Severity: Minor
Found in pypots/nn/modules/raindrop/layers.py - About 2 hrs to fix

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

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

      Function __init__ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(
              self,
              in_channels: Union[int, Tuple[int, int]],
              out_channels: int,
              n_nodes: int,
      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 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 forward has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def forward(
      Severity: Major
      Found in pypots/nn/modules/raindrop/layers.py - About 50 mins to fix

        Function message has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def message(
        Severity: Major
        Found in pypots/nn/modules/raindrop/layers.py - About 50 mins to fix

          Function message_selfattention has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def message_selfattention(
          Severity: Major
          Found in pypots/nn/modules/raindrop/layers.py - About 50 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

            There are no issues that match your filters.

            Category
            Status