deeplime-io/onecode

View on GitHub

Showing 26 of 26 total issues

File input_element.py has 358 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# SPDX-FileCopyrightText: 2023-2024 DeepLime <contact@deeplime.io>
# SPDX-License-Identifier: MIT

import re
from abc import ABC, abstractmethod
Severity: Minor
Found in onecode/elements/input_element.py - About 4 hrs to fix

    File project.py has 314 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # SPDX-FileCopyrightText: 2023-2024 DeepLime <contact@deeplime.io>
    # SPDX-License-Identifier: MIT
    
    import ast
    import json
    Severity: Minor
    Found in onecode/base/project.py - About 3 hrs to fix

      InputElement has 22 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class InputElement(ABC):
          """
          An element is an object that will be interpreted based on the Project's mode (script
          execution, extraction, etc.). OneCode projects should not
          directly call the `InputElement` but its corresponding static function defined as the snake
      Severity: Minor
      Found in onecode/elements/input_element.py - About 2 hrs to fix

        Function _prepare_and_validate has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            def _prepare_and_validate(
                self,
                value: Optional[Any]
            ) -> None:
                """
        Severity: Minor
        Found in onecode/elements/input_element.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 main has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        def main(
            data: Dict = None,
            flow_name: str = None,
            logger: logging.Handler = None
        ):
        Severity: Minor
        Found in onecode/cli/skeleton/main.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 value has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def value(self) -> Optional[pd.DataFrame]:
                """
                Returns:
                    The Pandas DataFrame loaded from the provided file path, otherwise None if the
                        file does not exists.
        Severity: Minor
        Found in onecode/elements/input/csv_reader.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 extract_gui has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        def extract_gui(
            project_path: str,
            to_file: str,
            verbose: bool = False
        ) -> None:
        Severity: Minor
        Found in onecode/cli/build.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 onecode/elements/input/file_input.py - About 1 hr to fix

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

              def __init__(
          Severity: Major
          Found in onecode/elements/input/slider.py - About 1 hr to fix

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

                def __init__(
            Severity: Major
            Found in onecode/elements/input/text_input.py - About 1 hr to fix

              Function value has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  def value(self) -> Optional[Union[List[str], str]]:
                      """
                      Returns:
                          The path or list of paths for the selected file(s): if paths are not absolute, then
                              they are considered relative to the data root folder. See
              Severity: Minor
              Found in onecode/elements/input/file_input.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 onecode/elements/input/number_input.py - About 1 hr to fix

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

                    def __init__(
                Severity: Major
                Found in onecode/elements/input/dropdown.py - About 1 hr to fix

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

                      def __init__(
                  Severity: Major
                  Found in onecode/elements/input/radio_button.py - About 1 hr to fix

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

                    def zip_output(
                        project_path: str,
                        data_path: str,
                        to_file: str,
                        compression_level: int,
                    Severity: Minor
                    Found in onecode/cli/zip.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 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(
                    Severity: Major
                    Found in onecode/elements/input/csv_reader.py - About 1 hr to fix

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

                          def __init__(
                      Severity: Major
                      Found in onecode/elements/input_element.py - About 50 mins to fix

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

                            def __init__(
                        Severity: Major
                        Found in onecode/elements/input/checkbox.py - About 50 mins to fix

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

                          def import_output(
                              init_file: str,
                              module_name: str
                          ) -> None:
                              """
                          Severity: Minor
                          Found in onecode/utils/import_output.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 onecode/elements/output/file_output.py - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language