steromano87/Woodpecker

View on GitHub

Showing 32 of 51 total issues

File httpsequence.py has 621 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import abc
import re
import sys

import gevent
Severity: Major
Found in woodpecker/sequences/httpsequence.py - About 1 day to fix

    HttpSequence has 28 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class HttpSequence(BaseSequence):
        __metaclass__ = abc.ABCMeta
    
        def __init__(self,
                     settings=None,
    Severity: Minor
    Found in woodpecker/sequences/httpsequence.py - About 3 hrs to fix

      Function search_by_data has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def search_by_data(self, event_data):
              if isinstance(event_data, dict):
                  found = False
                  for event_key, event in six.iteritems(self.events):
                      for search_key, search_value in six.iteritems(event_data):
      Severity: Minor
      Found in woodpecker/io/correlators/event.py - About 1 hr 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_http_request_entry has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def _generate_http_request_entry(self,
                                           event,
                                           is_resource=False,
                                           is_async=False):
              # Check for prepended events
      Severity: Minor
      Found in woodpecker/io/generators/html/httpsequencegenerator.py - About 1 hr 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 var_from_regex has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def var_from_regex(self,
                             name,
                             regex,
                             target='body',
                             instances='first',
      Severity: Minor
      Found in woodpecker/sequences/httpsequence.py - About 1 hr 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_wn_headers has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_wn_headers(self):
              # Retrieve white noise headers
              for index, entry in enumerate(self._parsed_entries.get('entries', [])):
                  if index == 0:
                      self.wn_headers = entry.request.headers
      Severity: Minor
      Found in woodpecker/io/correlators/htmlcorrelator.py - About 1 hr 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_request has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def _parse_request(self, index, resource):
              """
              Parses a request into HtmlResource
      
              :param index:
      Severity: Minor
      Found in woodpecker/io/parsers/html/sazparser.py - About 1 hr 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 _handle_event_list has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def _handle_event_list(self, event_list):
              for event in event_list:
                  if event.type in ('http_request', 'http_load_page'):
                      self._generate_load_page_entry(event)
                  elif event.type == 'http_load_resource':
      Severity: Minor
      Found in woodpecker/io/generators/html/httpsequencegenerator.py - About 1 hr 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 http_request has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def http_request(self,
                           url,
                           method='GET',
                           is_resource=False,
                           response_hooks=None,
      Severity: Minor
      Found in woodpecker/sequences/httpsequence.py - About 1 hr 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 calculate_events has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def calculate_events(self,
                               think_time_threshold=3.0,
                               new_sequence_threshold=7.0):
              previous_entry = HtmlResource()
      
      
      Severity: Minor
      Found in woodpecker/io/correlators/htmlcorrelator.py - About 1 hr 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_request has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def _parse_request(entry, resource):
              """
              Parses a request into HtmlResource
      
              :param entry:
      Severity: Minor
      Found in woodpecker/io/parsers/html/harparser.py - About 1 hr 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 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def get(self, name):
              if name not in six.viewkeys(self._reserved_variables):
                  if name in six.viewkeys(self._public_variables):
                      return self._public_variables.get(name)
                  else:
      Severity: Minor
      Found in woodpecker/io/variablejar.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

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

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

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

          def __init__(self,
      Severity: Minor
      Found in woodpecker/sequences/basesequence.py - About 45 mins to fix

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

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

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

              def delete(self, name):
                  if name not in six.viewkeys(self._reserved_variables):
                      if name in six.viewkeys(self._public_variables):
                          self._public_variables.pop(name)
                          self._reserved_variables['last_updated_on'] = \
          Severity: Minor
          Found in woodpecker/io/variablejar.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,
          Severity: Minor
          Found in woodpecker/sequences/httpsequence.py - About 45 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 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
                  Severity
                  Category
                  Status
                  Source
                  Language