Showing 53 of 329 total issues
File get_item.py
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding: utf8
# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
"""
UpdateItem
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class UpdateItem(Action):
"""
The `UpdateItem request <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html#API_UpdateItem_RequestParameters>`__.
"""
Function __raise
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def __raise(self, status_code, r):
try:
data = r.json()
except ValueError:
data = r.text
- 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 _convert_db_to_value
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _convert_db_to_value(value):
if "S" in value:
return value["S"]
elif "B" in value:
return bytes(base64.b64decode(value["B"].encode("utf8")))
- 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 __call__
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, action):
"""
Send requests and return responses.
"""
errors = []
- 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 __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function iterate_batch_get_item
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def iterate_batch_get_item(connection, table, *keys):
"""
Make as many :class:`.BatchGetItem` actions as needed to iterate over all specified items.
Including processing :attr:`.BatchGetItemResponse.unprocessed_keys`.
- 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 test_different_statuses
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_different_statuses(self):
self.requests_response.expect.status_code.andReturn(400)
self.requests_response.expect.json().andReturn({})
with self.assertRaises(_exn.ClientError):
self.responder(self.response_class.object, self.requests_response.object)
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function payload
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def payload(self):
# @todo Simplify, make more linear
data = {}
data.update(self.__table_name.payload)
schema = []
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function payload
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def payload(self):
data = {"IndexName": self.__name}
schema = []
if self._hash_key:
schema.append({"AttributeName": self._hash_key, "KeyType": "HASH"})
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, region, credentials, endpoint=None, retry_policy=None, requests_session=None):
Function __call__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __call__(self, key, secret, now, action, payload):
Function batch_put_item
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def batch_put_item(connection, table, *items):
"""
Make as many :class:`.BatchWriteItem` actions as needed to put all specified items.
Including processing :attr:`.BatchWriteItemResponse.unprocessed_items`.
- 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 batch_delete_item
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def batch_delete_item(connection, table, *keys):
"""
Make as many :class:`.BatchWriteItem` actions as needed to delete all specified keys.
Including processing :attr:`.BatchWriteItemResponse.unprocessed_items`.
- 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"