Showing 58 of 120 total issues
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, model, function_name, arguments,
Function database_backwards
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def database_backwards(self, app_label, schema_editor, from_state,
Function es_query
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def es_query(self, body, timeout=None, min_score=None, save_score=True,
Function database_forwards
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def database_forwards(self, app_label, schema_editor, from_state,
Function order_by_procedure
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def order_by_procedure(self, procname, *args, field='id', extra_fields=None,
Function field
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def field(self, field_name, field_label=None, field_cls=forms.CharField,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, model, name, commands, **kwargs):
Function es_get_field
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def es_get_field(self, field):
if field not in self.es_fields:
raise KeyError("Undeclared ElasticSearch field - {}." \
.format(field))
- 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 connectToken
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static connectToken(created, prev, next) {
if (prev == null) prev = I.fromJS({key: "__AND__"});
if (next == null) next = I.fromJS({key: "__AND__"});
const isCreatedUnitToken = !_.has(this.connectorMap,
- 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_actions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_actions(self):
if self.actions is None:
return {}
if self.user_serializer is None:
- 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
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return _.zip(p.args, c.args).some(([pa, ca]) => pa != ca);
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return self.handle_impossible_case()
Avoid too many return
statements within this function. Open
return
Function getTokens
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getTokens() {
this.tokenObjects = [];
this.setState({tokens: this.props.expression.map((obj, i) => {
const key = obj.get('key');
- 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_sorting
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_sorting(self):
if self.is_sortable:
options = self.sorting_options if self.is_multi_modeled else {
"_default": self.sorting_options
}
- 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 handle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def handle(self, *args, **options):
directories = set([dir_ for dir_ in get_app_template_dirs('templates')])
if len(settings.TEMPLATES) > 0:
if 'DIRS' in settings.TEMPLATES[0].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"