gszathmari/proxy-buster

View on GitHub

Showing 5 of 5 total issues

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

    def __init__(self, url):
        url_object = urlparse(url)
        self.url = url_object.geturl()
        self.scheme = url_object.scheme
        self.error = None
Severity: Minor
Found in buster.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

Avoid deeply nested control flow statements.
Open

                if len(results) > 0:
                    print("!!! %s additional scripts found, use '-v' for more details\n" % (len(results)))
                    if args.verbose:
                        print("!!! Injected scripts:")
                        for result in results:
Severity: Major
Found in buster.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                    if len(results) > 0:
                        print("!!! %s additional inline scripts found, use '-v' for more details\n" % (len(results)))
                        if args.verbose:
                            print("!!! The following inline scripts are inserted on this mirror:")
                            for result in results:
    Severity: Major
    Found in buster.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                      if not mirror:
                          print("-> %s does not exist in data file, skipping ...\n" % url)
                      # Skip if <title> between original and mirror does not match
                      elif original.title[:10] not in mirror.title:
                          pass
      Severity: Major
      Found in buster.py - About 45 mins to fix

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

        def populate_database_with_mirrors(urls, db):
            counter = 1
            for url in urls:
                print("-> Retrieving website (%s/%s): %s" % (counter, len(urls), url))
                # Create website Object
        Severity: Minor
        Found in buster.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