webcomics/dosage

View on GitHub

Showing 197 of 197 total issues

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

def get_tagged_scraper_name(scraperobj, limit=None, reasons=None):
    """Get comic scraper name."""
    tags = []
    if scraperobj.adult:
        tags.append(TAG_ADULT)
Severity: Minor
Found in dosagelib/cmd.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 find has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def find(self, comic: str) -> Scraper:
        """Find a comic scraper object based on its name. This prefers a
        perfect match, but falls back to a substring match, if that is unique.
        Otharwise a ValueError is thrown.
        """
Severity: Minor
Found in dosagelib/scraper.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 __del__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def __del__(self):
        """Remove the lock file."""
        if not self.initialized:
            return
        try:
Severity: Minor
Found in dosagelib/singleton.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__(self, name, sub, lang=None, adult=False, endOfLife=False, segmented=False):
Severity: Minor
Found in dosagelib/plugins/comicfury.py - About 45 mins to fix

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

    def get_module_plugins(module, classobj):
        """Return all subclasses of a class in the module.
        If the module defines __all__, only those entries will be searched,
        otherwise all objects not starting with '_' will be searched.
        """
    Severity: Minor
    Found in dosagelib/loader.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 run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def run(options):
        """Execute comic commands."""
        set_output_info(options)
        scrapercache.adddir(user_plugin_path)
        # ensure only one instance of dosage is running
    Severity: Minor
    Found in dosagelib/cmd.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 fetchText has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def fetchText(self, url, data, textSearch, optional):
            """Search text entry for given text XPath in a HTML page."""
            if not textSearch:
                return None
            text = []
    Severity: Minor
    Found in dosagelib/scraper.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__(self, name, sub, first, last=None, adult=False, nav=None):
    Severity: Minor
    Found in dosagelib/plugins/rickgriffinstudios.py - About 45 mins to fix

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

      def tagre(tag, attribute, value, quote='"', before="", after=""):
      Severity: Minor
      Found in dosagelib/util.py - About 45 mins to fix

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

        def urlopen(url, session, referrer=None, max_content_bytes=None,
        Severity: Minor
        Found in dosagelib/util.py - About 45 mins to fix

          Consider simplifying this complex logical expression.
          Open

                  if 'paprika' in pageUrl and '69-2' in pageUrl:
                      filename = filename.replace('69', '69-2')
                  elif 'rascals' in pageUrl and '89-2' in pageUrl:
                      filename = filename.replace('89', '90')
                  elif 'rascals' in pageUrl and '133-2' in pageUrl:
          Severity: Major
          Found in dosagelib/plugins/kemonocafe.py - About 40 mins to fix

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

                def write_entry(self, fp, name, entry, min_comics, indent):
            Severity: Minor
            Found in scripts/scriptutil.py - About 35 mins to fix

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

                  def __init__(self, name, sub, last=None, adult=False, path='d/%s.html'):
              Severity: Minor
              Found in dosagelib/plugins/keenspot.py - About 35 mins to fix

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

                    def __init__(self, name, path, first, sid, eol=False):
                Severity: Minor
                Found in dosagelib/plugins/shivaestudios.py - About 35 mins to fix

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

                      def __init__(self, title, link, description, lang='en-us', encoding="utf-8"):
                  Severity: Minor
                  Found in dosagelib/rss.py - About 35 mins to fix

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

                        def addItem(self, title, link, description, date, append=True):
                    Severity: Minor
                    Found in dosagelib/rss.py - About 35 mins to fix

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

                          def __init__(self, name, sub=None, last=None, baseUrl=None, lang=None):
                      Severity: Minor
                      Found in dosagelib/plugins/comicgenesis.py - About 35 mins to fix

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

                            def __init__(self, scraper, url, referrer, filename, text=None):
                        Severity: Minor
                        Found in dosagelib/comic.py - About 35 mins to fix

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

                              def __init__(self, name, sub, first, last=None, adult=False):
                          Severity: Minor
                          Found in dosagelib/plugins/kemonocafe.py - About 35 mins to fix

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

                                def __init__(self, name, sub, prev, first, last=None):
                            Severity: Minor
                            Found in dosagelib/plugins/rhjunior.py - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language