Showing 579 of 869 total issues
Function _setup
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
_setup: function _setup() {
var that = this;
var columns = [];
var obj = {
language: this.options.lang.code,
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
def handle(self, *args, **options):
"""
Obtains a plugin report -
cms.management.commands.subcommands.list.plugin_report - and uses it
to delete orphaned plugins from the database, i.e. ones that are no
- 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_language_from_request
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_language_from_request(request, current_page=None):
"""
Return the most obvious language according the request
"""
language = 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
Function get_context
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_context(self, context, from_level, to_level, extra_inactive,
extra_active, template, namespace, root_id, next_page):
try:
# If there's an exception (500), default context_processors may not be called.
request = context['request']
- 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_registered_menus
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_registered_menus(self, for_rendering=False):
"""
Returns all registered menu classes.
:param for_rendering: Flag that when True forces us to include
- 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 toArray
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
toArray: function(options) {
var o = $.extend({}, this.options, options),
sDepth = o.startDepthCount || 0,
ret = [],
Function opening
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
opening: function() {
var cid = this.containerEventName,
scroll = "scroll." + cid,
resize = "resize."+cid,
orient = "orientationchange."+cid,
Function initModal
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
var initModal = once(function initModal() {
var placeholder = $(
'<div class="cms-add-plugin-placeholder">' + CMS.config.lang.addPluginPlaceholder + '</div>'
);
var dragItem = nav.closest('.cms-dragitem');
Function select2
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.select2 = function () {
var args = Array.prototype.slice.call(arguments, 0),
opts,
select2,
Function _delegate
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
_delegate: function _delegate(el) {
// save local vars
var target = el.data('rel');
if (el.hasClass('cms-btn-disabled')) {
Function _setup
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setup: function _setup(options) {
$('#' + options.id).select2({
placeholder: options.text,
allowClear: true,
multiple: false,
Function _show
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
_show(opts) {
// we need to position the modal in the center
var that = this;
var width = opts.width;
var height = opts.height;
Function toggleCollapsable
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
_toggleCollapsable: function toggleCollapsable(el) {
var that = this;
var id = that._getId(el.parent());
var draggable = el.closest('.cms-draggable');
var 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 changelist_view
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def changelist_view(self, request, extra_context=None):
from django.contrib.admin.views.main import ERROR_FLAG
if not self.has_change_permission(request, obj=None):
raise PermissionDenied
- 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 render_extra_menu_items
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def render_extra_menu_items(context, obj, template='cms/toolbar/dragitem_extra_menu.html'):
request = context['request']
toolbar = get_toolbar_from_request(request)
template = toolbar.templates.get_cached_template(template)
- 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 _paste
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
_paste: function _paste(event) {
// hide helpers after we picked one
this._disablePaste();
var copyFromId = this._getNodeId(
- 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 find_ancestors_and_remove_children
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def find_ancestors_and_remove_children(self, node, nodes):
"""
Check ancestors of node for soft roots
"""
if node.parent:
- 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 clean
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def clean(self):
data = super().clean()
# Validate Page options
if not data.get('can_change_page'):
- 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_page_path
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def get_page_path(self, lang):
page = getattr(self.request, 'current_page', None)
if not page:
return '/%s/' % lang if settings.USE_I18N else '/'
- 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 set_page_cache
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def set_page_cache(response):
from django.core.cache import cache
request = response._request
toolbar = get_toolbar_from_request(request)
- 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"