steromano87/Woodpecker

View on GitHub
woodpecker/sequences/httpsequence.py

Summary

Maintainability
D
2 days
Test Coverage

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

              def put(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

                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 _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

                        There are no issues that match your filters.

                        Category
                        Status