tubone24/ebook_homebrew

View on GitHub

Showing 7 of 176 total issues

Function add_before_after_str has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def add_before_after_str(self, before, after):
        """Add file name specify string.

        After changing file name for filename_to_digit_number() method,
        add specify string before or after file name.
Severity: Minor
Found in ebook_homebrew/rename.py - About 2 hrs 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 make_pdf has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def make_pdf(self, filename, remove_flag=False):
        """Make pdf file take in some image files.

        Make pdf file which you use e-books by take in some image
        files such as jpeg, png and gif.
Severity: Minor
Found in ebook_homebrew/convert.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 change_name_manually has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def change_name_manually(self, overwrite=False):
        """Change filename manually looking exist_file list.

        After changing file name for filename_to_digit_number() method,
        duplicate file name change manually.
Severity: Minor
Found in ebook_homebrew/rename.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 make_zip has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def make_zip(self, filename, remove_flag=False, overwrite=False):
        """Make zip file for adding specify extension files.

        Make zip file for files which you choose extension.

Severity: Minor
Found in ebook_homebrew/archive.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_extension_with_dot has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _convert_extension_with_dot(extension):
        """Convert extension with dot like "jpg" to ".jpg"

        Args:
            extension (str): Convert extension with dot like "jpg" to ".jpg"
Severity: Minor
Found in ebook_homebrew/core.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

Function download has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def download(args):
    """download result PDF"""

    if not args["--host"]:
        host = "http://localhost"
Severity: Minor
Found in examples/use_rest_api/src/main.py - About 25 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 __check_exist_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def __check_exist_file(self, new_name, old_name, append_list):
        """Check current directory and exists same name file, return true.
        Args:
            new_name (str): Target file name.
            old_name (str): before name
Severity: Minor
Found in ebook_homebrew/rename.py - About 25 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