Showing 43 of 51 total issues
Function async_http_request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def async_http_request(self,
Function delete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def delete(self,
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(self,
Function post
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def post(self,
Function var_from_regex
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def var_from_regex(self,
Function patch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def patch(self,
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
"""
- Read upRead up
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):
- Read upRead up
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
- Read upRead up
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 \
- Read upRead up
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 = \
- Read upRead up
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)
- Read upRead up
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 \
- Read upRead up
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:
- Read upRead up
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]
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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