Showing 579 of 869 total issues
Function clean
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def clean(self):
"""
Validates that either the slug is provided, or that slugification from
`title` produces a valid slug.
:return:
- 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, request, request_path=None, _async=False):
super().__init__()
self._async = _async
self.right_items = []
self.left_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 _get_empty_context
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_empty_context(self, context, instance, edit_fields, language,
Function copy
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def copy(self, site, parent_node=None, language=None,
Function create_option
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_option(self, name, value, label, selected, index, subindex=None, attrs=None):
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, title, weight, form, model=None, template_name=None,
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name, url, active=False, disabled=False,
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, title, url, id, parent_id=None, parent_namespace=None,
Function add_link_item
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_link_item(self, name, url, active=False, disabled=False,
Avoid deeply nested control flow statements. Open
if (opts.initSelection === undefined) {
opts.initSelection = function (element, callback) {
var data = [];
$(splitVal(element.val(), opts.separator)).each(function () {
var obj = { id: this, text: this },
Avoid deeply nested control flow statements. Open
if (gridCellPrev && gridCellPrev.length > 0) {
last.insertAfter(gridCellPrev);
} else if (gridCellChild && gridCellChild.length > 0) {
last.insertBefore(gridCellChild);
} else if (gridCellNext && gridCellNext.length > 0) {
Avoid deeply nested control flow statements. Open
} else if ( ! o.protectRoot) {
this._rearrange(event, item);
}
Function initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
initialize: function initialize(container, options) {
this.options = $.extend(true, {}, this.options, options);
// create an unique for this component to use it internally
this.uid = uid();
- 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 deeply nested control flow statements. Open
if (equal(opts.id(token), opts.id(selection[i]))) {
dupe = true; break;
}
Avoid deeply nested control flow statements. Open
if (opts.createSearchChoice === undefined) {
opts.createSearchChoice = function (term) { return {id: $.trim(term), text: $.trim(term)}; };
}
Avoid deeply nested control flow statements. Open
if (this.currentItem[0].parentNode != this.element[0]
&& itemElement.parentNode == this.element[0]
) {
if ( ! $(itemElement).children(o.listType).length) {
Function open
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
open(opts) {
// setup internals
if (!((opts && opts.url) || (opts && opts.html))) {
throw new Error('The arguments passed to "open" were invalid.');
}
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def handle(self, *args, **options):
report = plugin_report()
self.stdout.write('==== Plugin report ==== \n\n')
self.stdout.write('There are %s plugin types in your database \n' % len(report))
for plugin in report:
- 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 is_cms_request
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def is_cms_request(self, request):
toolbar_hide = get_cms_setting('TOOLBAR_HIDE')
internal_ips = get_cms_setting('INTERNAL_IPS')
if internal_ips:
- 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 _initialStates
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_initialStates: function _initialStates() {
var publishBtn = $('.cms-btn-publish').parent();
this._show({ duration: 0 });
- 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"