WenjieDu/PyPOTS

View on GitHub

Showing 376 of 433 total issues

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 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 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 __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 __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/saits/backbone.py - About 1 hr to fix

          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/imputation/film/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/tide/core.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

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

              def sample_factor_x_partial(tau_sparse_tensor, tau_ind, time_lags, U, V, X, A, Lambda_x, back_step):
              Severity: Major
              Found in pypots/forecasting/bttf/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/fedformer/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/forecasting/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/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/forecasting/bttf/model.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/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/micn/backbone.py - About 1 hr to fix

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

                            def BTTF_forecast(
                            Severity: Major
                            Found in pypots/forecasting/bttf/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/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/clustering/base.py - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language