steromano87/Woodpecker

View on GitHub

Showing 43 of 51 total issues

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

    def async_http_request(self,
Severity: Minor
Found in woodpecker/sequences/httpsequence.py - About 35 mins to fix

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

        def delete(self,
    Severity: Minor
    Found in woodpecker/sequences/httpsequence.py - About 35 mins to fix

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

          def get(self,
      Severity: Minor
      Found in woodpecker/sequences/httpsequence.py - About 35 mins to fix

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

            def post(self,
        Severity: Minor
        Found in woodpecker/sequences/httpsequence.py - About 35 mins to fix

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

              def var_from_regex(self,
          Severity: Minor
          Found in woodpecker/sequences/httpsequence.py - About 35 mins to fix

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

                def patch(self,
            Severity: Minor
            Found in woodpecker/sequences/httpsequence.py - About 35 mins to fix

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

              def init(ctx, force):
                  """
                  Initialize a folder for usage with Woodpecker.
                  If an existing installation is found, returns an error 
                  """
              Severity: Minor
              Found in woodpecker/cli/commands/init.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 generate_command has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def generate_command(self):
                      output = six.moves.cStringIO()
              
                      # Write command
                      for _ in six.moves.range(0, self._indents):
              Severity: Minor
              Found in woodpecker/io/generators/basegenerator.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 _add_http_redirect_event has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _add_http_redirect_event(self, entry, previous_entry=HtmlResource()):
                      event = self._create_http_request_event(entry, 'http_redirect')
                      if entry.url in \
                              previous_entry.response.headers.get('Location', ''):
                          # Try to add the redirect to the direct first level event
              Severity: Minor
              Found in woodpecker/io/correlators/htmlcorrelator.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 get_redirects has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def get_redirects(self):
                      for entry in self._parsed_entries.get('entries', []):
                          # If the response has a Location and the status is a 3XX,
                          # add the location to redirects
                          for header_name, header_value \
              Severity: Minor
              Found in woodpecker/io/correlators/htmlcorrelator.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 _request_log_hook has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _request_log_hook(self, is_async=False, is_resource=False):
                      def _request_log_hook_gen(response, **kwargs):
                          # Log request status in inline logger
                          if is_async:
                              str_inline_message = \
              Severity: Minor
              Found in woodpecker/sequences/httpsequence.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 _create_http_request_event has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _create_http_request_event(self, entry, type_name):
                      event = Event(type_name, event_id=entry.url)
              
                      # Clean headers from white noise headers
                      cleaned_headers = deepcopy(entry.request.headers)
              Severity: Minor
              Found in woodpecker/io/correlators/htmlcorrelator.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 get_referers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def get_referers(self):
                      # Start reading the loaded entries and getting the Referers
                      for entry in self._parsed_entries.get('entries', []):
                          # If the call has a referer, add the referer to list
                          for header_name, header_value \
              Severity: Minor
              Found in woodpecker/io/correlators/htmlcorrelator.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 _parse_timings has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _parse_timings(self, index, resource):
                      """
                      Parses the timings into HtmlResource
              
                      :param index:
              Severity: Minor
              Found in woodpecker/io/parsers/html/sazparser.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

              Invalid escape sequence '\d'
              Open

                      index_list = sorted(set([re.findall("\d+", zip_file)[0]

              Invalid escape sequences are deprecated in Python 3.6.

              Okay: regex = r'\.png$'
              W605: regex = '\.png$'

              Trailing whitespace
              Open

                  Updates the folder settings by merging the actual settings with the 
              Severity: Minor
              Found in woodpecker/cli/commands/update.py by pep8

              Trailing whitespace is superfluous.

              The warning returned varies on whether the line itself is blank,
              for easier filtering for those who want to indent their blank lines.
              
              Okay: spam(1)\n#
              W291: spam(1) \n#
              W293: class Foo(object):\n    \n    bang = 12

              Trailing whitespace
              Open

                  If the sequence type is provided, all the required include statements 
              Severity: Minor
              Found in woodpecker/cli/commands/generate.py by pep8

              Trailing whitespace is superfluous.

              The warning returned varies on whether the line itself is blank,
              for easier filtering for those who want to indent their blank lines.
              
              Okay: spam(1)\n#
              W291: spam(1) \n#
              W293: class Foo(object):\n    \n    bang = 12

              Expected 2 blank lines after class or function definition, found 1
              Open

              woodpecker.add_command(init)
              Severity: Minor
              Found in woodpecker/cli/woodpecker.py by pep8

              Separate top-level function and class definitions with two blank lines.

              Method definitions inside a class are separated by a single blank
              line.
              
              Extra blank lines may be used (sparingly) to separate groups of
              related functions.  Blank lines may be omitted between a bunch of
              related one-liners (e.g. a set of dummy implementations).
              
              Use blank lines in functions, sparingly, to indicate logical
              sections.
              
              Okay: def a():\n    pass\n\n\ndef b():\n    pass
              Okay: def a():\n    pass\n\n\nasync def b():\n    pass
              Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
              Okay: default = 1\nfoo = 1
              Okay: classify = 1\nfoo = 1
              
              E301: class Foo:\n    b = 0\n    def bar():\n        pass
              E302: def a():\n    pass\n\ndef b(n):\n    pass
              E302: def a():\n    pass\n\nasync def b(n):\n    pass
              E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
              E303: def a():\n\n\n\n    pass
              E304: @decorator\n\ndef a():\n    pass
              E305: def a():\n    pass\na()
              E306: def a():\n    def b():\n        pass\n    def c():\n        pass

              Trailing whitespace
              Open

                  If the sequence type is provided, all the required include statements 
              Severity: Minor
              Found in woodpecker/cli/commands/generate.py by pep8

              Trailing whitespace is superfluous.

              The warning returned varies on whether the line itself is blank,
              for easier filtering for those who want to indent their blank lines.
              
              Okay: spam(1)\n#
              W291: spam(1) \n#
              W293: class Foo(object):\n    \n    bang = 12

              Trailing whitespace
              Open

                  will be automatically added, else the type of the sequence will be 
              Severity: Minor
              Found in woodpecker/cli/commands/generate.py by pep8

              Trailing whitespace is superfluous.

              The warning returned varies on whether the line itself is blank,
              for easier filtering for those who want to indent their blank lines.
              
              Okay: spam(1)\n#
              W291: spam(1) \n#
              W293: class Foo(object):\n    \n    bang = 12
              Severity
              Category
              Status
              Source
              Language