webcomics/dosage

View on GitHub

Showing 85 of 223 total issues

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 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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

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

      def getScrapers(comics, basepath=None, adult=True, multiple_allowed=False, listing=False):
      Severity: Minor
      Found in dosagelib/director.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 __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 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, lang=None, adult=False, endOfLife=False):
                  Severity: Minor
                  Found in dosagelib/plugins/comicfury.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, prev, first, last=None):
                        Severity: Minor
                        Found in dosagelib/plugins/rhjunior.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, path, first, sid, eol=False):
                            Severity: Minor
                            Found in dosagelib/plugins/shivaestudios.py - About 35 mins to fix

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

                                  def namer(self, imageUrl, pageUrl):
                                      filename = imageUrl.rsplit('/', 1)[-1].split('.', 1)[0]
                                      ext = imageUrl.rsplit('.', 1)[-1]
                                      if filename == 'j':
                                          filename = 'RF_E3_P52'
                              Severity: Minor
                              Found in dosagelib/plugins/r.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 _matchPattern has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def _matchPattern(self, data, patterns):
                                      if self.css:
                                          searchFun = data.cssselect
                                      else:
                                          def searchFun(s):
                              Severity: Minor
                              Found in dosagelib/scraper.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 connect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def connect(self, lastchange=None):
                                      """Connect to host and get meta information."""
                                      headers = {}
                                      if lastchange:
                                          headers['If-Modified-Since'] = lastchange.strftime(RFC_1123_DT_STR)
                              Severity: Minor
                              Found in dosagelib/comic.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 save has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def save(self, basepath):
                                      """Save comic URL to filename on disk."""
                                      fnbase = self._fnbase(basepath)
                                      exist = [x for x in glob.glob(fnbase + ".*") if not x.endswith(".txt")]
                                      out.info(u"Get image URL %s" % self.url, level=1)
                              Severity: Minor
                              Found in dosagelib/comic.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 strsize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def strsize(b):
                                  """Return human representation of bytes b. A negative number of bytes
                                  raises a value error."""
                                  if b < 0:
                                      raise ValueError("Invalid negative byte number")
                              Severity: Minor
                              Found in dosagelib/util.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