bitranox/rst_include

View on GitHub

Showing 11 of 11 total issues

File lib_get_include_options.py has 279 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# STDLIB
from typing import List, Tuple, Union

# OWN
import lib_log_utils
Severity: Minor
Found in rst_include/libs/lib_get_include_options.py - About 2 hrs to fix

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

    def import_module_from_file(module_fullpath: Union[pathlib.Path, str], reload: bool = False):  # type: ignore
        """
        TODO : replace with lib_import when avail maybe take from pycharm
        """
        module_fullpath = pathlib.Path(module_fullpath)
    Severity: Minor
    Found in rst_include/rst_include.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 rst_str_replace has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def rst_str_replace(source: Union[pathlib.Path, IO[str]],  # str, file or sys.stdin
    Severity: Major
    Found in rst_include/libs/lib_main.py - About 1 hr to fix

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

      def replace(
      Severity: Major
      Found in rst_include/rst_include.py - About 1 hr to fix

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

        def cli_replace(
        Severity: Major
        Found in rst_include/rst_include_cli.py - About 1 hr to fix

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

          def check_source_and_target(source: Union[pathlib.Path, IO[str]],
                                      target: Union[pathlib.Path, IO[str], None],
                                      in_place: bool) -> Tuple[Union[pathlib.Path, IO[str]], Union[pathlib.Path, IO[str], None]]:
              """
          
          
          Severity: Minor
          Found in rst_include/libs/lib_check_files.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 include has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def include(source: str, target: str, quiet: bool, inplace: bool, source_encoding: str, target_encoding: str) -> None:
          Severity: Minor
          Found in rst_include/rst_include.py - About 45 mins to fix

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

            def cli_include(source: str, target: str, quiet: bool, inplace: bool, source_encoding: str, target_encoding: str) -> None:  # pragma: no cover
            Severity: Minor
            Found in rst_include/rst_include_cli.py - About 45 mins to fix

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

                  def __init__(self,
              Severity: Minor
              Found in rst_include/libs/lib_classes.py - About 35 mins to fix

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

                def rst_inc(source: Union[pathlib.Path, IO[str]],
                Severity: Minor
                Found in rst_include/libs/lib_main.py - About 35 mins to fix

                  Function get_include_filename has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def get_include_filename(block: Block) -> Tuple[pathlib.Path, pathlib.Path]:
                      """
                      >>> block = lib_test.get_test_block_ok()
                  
                      >>> # test include Filename OK
                  Severity: Minor
                  Found in rst_include/libs/lib_get_include_options.py - About 35 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

                  Severity
                  Category
                  Status
                  Source
                  Language