Showing 51 of 57 total issues

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

    def get_ancillary_filepath(
Severity: Major
Found in tsdat/io/base/storage.py - About 1 hr to fix

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

        def _is_balanced(cls, template: str):
            stack: list[str] = []
            for char in template:
                if char in "{[":
                    stack.append("}" if char == "{" else "]")
    Severity: Minor
    Found in tsdat/tstring.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 convert has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def convert(
    Severity: Major
    Found in tsdat/transform/converters.py - About 1 hr to fix

      Function convert has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def convert(
      Severity: Major
      Found in tsdat/transform/converters.py - About 1 hr to fix

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

            def __init__(self, input_key: str):
                kwargs: Dict[str, str] = {}
        
                if len(input_key.split("::")) == 3:
                    logger.warning(
        Severity: Minor
        Found in tsdat/io/retrievers/storage_retriever_input.py - About 55 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 select_parameters has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def select_parameters(self, input_key: str) -> Dict[str, Dict[str, Any]]:
                selected_params: Dict[str, Dict[str, Any]] = {
                    "alignment": {},
                    "range": {},
                    "width": {},
        Severity: Minor
        Found in tsdat/io/retrievers/global_arm_transform_params.py - About 55 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

        Avoid deeply nested control flow statements.
        Open

                            if data_var_data[name].equals(xr.DataArray([])):
                                logger.warning(
                                    "Input key matched regex pattern but no matching variable"
                                    " could be found in the input dataset. A value of"
                                    " xr.DataArray([]) will be used instead.\n"
        Severity: Major
        Found in tsdat/io/retrievers/perform_data_retrieval.py - About 45 mins to fix

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

              def _write_transform_parameter_row(
          Severity: Minor
          Found in tsdat/transform/adi.py - About 45 mins to fix

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

                def _find_data(
            Severity: Minor
            Found in tsdat/io/storage/file_system.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if not coord_data[name].equals(xr.DataArray([])):
                                      variable_retriever.source = input_key
                                  selected_coord_rules[name] = variable_retriever
              Severity: Major
              Found in tsdat/io/retrievers/perform_data_retrieval.py - About 45 mins to fix

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

                    def _find_data(
                Severity: Minor
                Found in tsdat/io/storage/file_system_s3.py - About 45 mins to fix

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

                      def fetch_data(
                  Severity: Minor
                  Found in tsdat/io/storage/file_system.py - About 45 mins to fix

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

                        def retrieve(
                    Severity: Minor
                    Found in tsdat/io/retrievers/storage_retriever.py - About 45 mins to fix

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

                      def _create_bounds(
                          coordinate: xr.DataArray,
                          alignment: Literal["LEFT", "RIGHT", "CENTER"],
                          width: str,
                      ) -> xr.DataArray:
                      Severity: Minor
                      Found in tsdat/transform/converters.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 fetch_data has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def fetch_data(
                      Severity: Minor
                      Found in tsdat/io/base/storage.py - About 45 mins to fix

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

                            def last_modified(self, datastream: str) -> Union[datetime, None]:
                                """Returns the datetime of the last modification to the datastream's storage area."""
                                substitutions = get_fields_from_datastream(datastream)
                                substitutions["datastream"] = datastream
                                prefix = self._get_data_directory(substitutions).as_posix()
                        Severity: Minor
                        Found in tsdat/io/storage/file_system_s3.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

                        Consider simplifying this complex logical expression.
                        Open

                                if (
                                    retrieved_dataset is not None
                                    and input_key is not None
                                    and retriever is not None
                                    and retriever.parameters is not None
                        Severity: Major
                        Found in tsdat/transform/converters.py - About 40 mins to fix

                          Function convert has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def convert(
                          Severity: Minor
                          Found in tsdat/io/base/data_converter.py - About 35 mins to fix

                            Function convert has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def convert(
                            Severity: Minor
                            Found in tsdat/io/converters/units_converter.py - About 35 mins to fix

                              Function convert has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def convert(
                              Severity: Minor
                              Found in tsdat/io/converters/nearest_neighbor.py - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language