steromano87/Woodpecker

View on GitHub

Showing 32 of 51 total issues

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

          Severity
          Category
          Status
          Source
          Language