Showing 579 of 869 total issues
Function updateResults
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateResults: function (initial) {
var search = this.search,
results = this.results,
opts = this.opts,
data,
Function _get_page_by_untyped_arg
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def _get_page_by_untyped_arg(page_lookup, request, site_id):
"""
The `page_lookup` argument can be of any of the following types:
- Integer: interpreted as `pk` of the desired page
- String: interpreted as `reverse_id` of the desired 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_cache_expiration
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def get_cache_expiration(self, request, response_timestamp):
"""
Returns the number of seconds (from «response_timestamp») that this
placeholder can be cached. This is derived from the plugins it contains.
- 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 check_copy_relations
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def check_copy_relations(output):
from cms.extensions import extension_pool
from cms.extensions.models import BaseExtension
from cms.models.pluginmodel import CMSPlugin
from cms.plugin_pool import plugin_pool
- 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 _setButtons
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setButtons(iframe) {
var djangoSuit = iframe.contents().find('.suit-columns').length > 0;
var that = this;
var group = $('<div class="cms-modal-item-buttons"></div>');
var render = $('<div class="cms-modal-buttons-inner"></div>');
Function init
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function (opts) {
var results, search, resultsSelector = ".select2-results";
// prepare options
this.opts = opts = this.prepareOpts(opts);
File menu_tags.py
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
from urllib.parse import unquote
from classytags.arguments import Argument, IntegerArgument, StringArgument
from classytags.core import Options
from classytags.helpers import InclusionTag
Function bind
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.bind = function () {
parent.bind.call(this);
this._initialize();
this.element
.on("move_node.jstree create_node.jstree clean_node.jstree change_node.jstree", $.proxy(function (e, data) {
File check.py
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
import inspect
from contextlib import contextmanager
from itertools import chain
from django.conf import settings
Function set_or_create
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def set_or_create(self, request, page, form, language):
"""
set or create a title for a particular page and language
"""
base_fields = [
- 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 27 (exceeds 5 allowed). Consider refactoring. Open
def get_context(self, context, levels, root_level, nephews, template):
# Django 1.4 doesn't accept 'None' as a tag value and resolve to ''
# So we need to force it to None again
if not root_level and root_level != 0:
root_level = 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 _setup
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setup: function _setup() {
var that = this;
var columns = [];
var obj = {
language: this.options.lang.code,
Function _initializeGlobalHandlers
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Plugin._initializeGlobalHandlers = function _initializeGlobalHandlers() {
var timer;
var clickCounter = 0;
Plugin._updateClipboard();
Function get_placeholder_conf
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def get_placeholder_conf(setting, placeholder, template=None, default=None):
"""
Returns the placeholder configuration for a given setting. The key would for
example be 'plugins' or 'name'.
- 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 resolve_page_id
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def resolve_page_id(self, path):
"""Resolves requested path similar way how resolve does, but instead
of return callback,.. returns page_id to which was application
assigned.
"""
- 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
Consider simplifying this complex logical expression. Open
if (a.length === 1) {
closed = !objData.state.opened;
gridCellName = GRIDCELLID_PREFIX+escapeId(lid)+GRIDCELLID_POSTFIX;
gridCellParentId = objData.parent === "#" ? null : objData.parent;
a.addClass(c);
CMSPluginBase
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class CMSPluginBase(admin.ModelAdmin, metaclass=CMSPluginBaseMetaclass):
name = ""
module = _("Generic") # To be overridden in child classes
CMSToolbar
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class CMSToolbar(BaseToolbar):
"""
The default CMS Toolbar
"""
Function __call__
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, request):
if not self.is_cms_request(request):
return self.get_response(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_menu_node_for_page
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def get_menu_node_for_page(renderer, page, language, fallbacks=None):
"""
Transform a CMS page into a navigation node.
:param renderer: MenuRenderer instance bound to the 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"