Showing 1,384 of 1,384 total issues
Avoid deeply nested control flow statements. Open
if len(_metadata[index][value]) == 0: # pragma: no cover
del _metadata[index][value]
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if not isinstance(value, Key):
if not getattr(value, 'key', None):
raise TypeError('Cannot set non-embedded entity to object without'
' a key. Got: "%s".' % value)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if not choices: # pragma: no cover
raise RuntimeError('No template path configured.')
- Create a ticketCreate a ticket
Function fillStructure
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fillStructure(self, fill, case_sensitive=False, **kwargs):
""" If handed a dictionary, will fill self with those entries. Usually
called from ``__init__``.
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid deeply nested control flow statements. Open
if k.startswith('__'): continue
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if hasattr(v, '__hooks__') and v.__hooks__:
v.__register__(target)
# attach bindings to target class
target.__aliases__, target.__bindings__ = (
- Create a ticketCreate a ticket
Function render
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def render(self, template,
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if subquery.sub_operator is query.AND:
_and_filters.append(subquery)
if subquery.sub_operator is query.OR:
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if len(tails) == 1 and cls.EngineConfig.mode in (
RedisMode.hashkey_blob,
RedisMode.hashkind_blob):
_target_handler = cls.Operations.HASH_GET
else:
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if not _q_init: # no frame yet, initialize
_q_init = True
_data_frame = (
set((value for _, value in filter(evaluate, index))))
else: # otherwise, filter
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if subquery.sub_operator is query.OR:
_or_filters.append(subquery)
- Create a ticketCreate a ticket
Function to
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def to(cls, *targets, **options):
""" Syntactic sugar for creating an on-the-fly :py:class:`Edge` subclass.
:param target: Target :py:class:`Vertex` subclass to factory
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid deeply nested control flow statements. Open
if isinstance(_path, dict) and 'compiled' in _path:
try:
choices.append(ModuleLoader(_path['compiled']))
except jinja2.TemplateNotFound: # pragma: no cover
pass # no compiled template root at all
- Create a ticketCreate a ticket
Function resolve
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def resolve(cls):
""" """
# @TODO(sgammon): figure out how to prioritize/select a runtime
- Read upRead up
- Create a ticketCreate a ticket
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
for datapoint in self.__slots__:
setattr(self, datapoint, kwargs[datapoint] if datapoint in (
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 35.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid deeply nested control flow statements. Open
if _global:
_key = '.'.join((namespace, alias)) if namespace else alias
property_bucket[_key] = (responder, prop)
continue
property_bucket[_key] = (responder, prop)
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
filters = filters and ([filters] if not (
isinstance(filters, (list, tuple))) else filters) or None
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 35.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid deeply nested control flow statements. Open
if (this_value is EMPTY) or override:
self._set_option(option, value)
return self
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if concrete.__binding__:
property_bucket[concrete.__binding__.__alias__] = (
struct.CallbackProxy(do_pluck(*(
concrete,
responder,
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
option_names = frozenset(('_'.join(opt.split('_')[1:]) for opt in options))
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 35.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76