Showing 53 of 329 total issues
File return_types.py
has 643 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# coding: utf8
# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
import datetime
File update_item.py
has 584 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# coding: utf8
# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
"""
File query.py
has 552 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# coding: utf8
# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
"""
File update_table.py
has 493 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# coding: utf8
# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
"""
File create_table.py
has 491 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# coding: utf8
# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
"""
File connection.py
has 436 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# coding: utf8
# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
import datetime
File batch_get_item.py
has 431 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# coding: utf8
# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
"""
File batch_write_item.py
has 423 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# coding: utf8
# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
"""
File delete_item.py
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# coding: utf8
# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
"""
ConversionUnitTests
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class ConversionUnitTests(_tst.UnitTests):
def test_convert_unicode_value_to_db(self):
self.assertEqual(_convert_value_to_db(u"éoà"), {"S": u"éoà"})
def test_convert_bytes_value_to_db(self):
File put_item.py
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# coding: utf8
# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
"""
When given a :class:`PutItem`, the connection will return a :class:`PutItemResponse`:
File next_gen_mixins.py
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# coding: utf8
# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
import numbers
UpdateTableUnitTests
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class UpdateTableUnitTests(_tst.UnitTests):
def test_name(self):
self.assertEqual(UpdateTable("Foo").name, "UpdateTable")
def test_constructor(self):
File scan.py
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# coding: utf8
# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
"""
Query
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Query(Action):
"""
The `Query request <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html#API_Query_RequestParameters>`__.
"""
QueryUnitTests
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class QueryUnitTests(_tst.UnitTests):
def test_name(self):
self.assertEqual(Query("Aaa").name, "Query")
def test_table_name(self):
CreateTableUnitTests
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class CreateTableUnitTests(_tst.UnitTests):
def test_name(self):
self.assertEqual(CreateTable("Foo").name, "CreateTable")
def test_constructor(self):
Function variadic
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
def variadic(typ):
"""
Decorator taking a variadic function and making a very-variadic function from it:
a function that can be called with a variable number of iterables of arguments.
- 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
UpdateItemUnitTests
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class UpdateItemUnitTests(_tst.UnitTests):
def test_name(self):
self.assertEqual(UpdateItem("Table", {"hash": 42}).name, "UpdateItem")
def test_table_name_and_key(self):
Function _convert_value_to_db
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
def _convert_value_to_db(value):
if isinstance(value, unicode):
return {"S": value}
elif isinstance(value, bytes):
return {"B": base64.b64encode(value).decode("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"