Showing 579 of 869 total issues
Function _prepare_grid
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
this._prepare_grid = function (obj) {
var gs = this._gridSettings, c = gs.treeClass, _this = this, t, cols = gs.columns || [], width, tr = gs.isThemeroller,
tree = this.element, rootid = this.rootid,
classAdd = (tr?"themeroller":"regular"), img, objData = this.get_node(obj),
defaultWidth = gs.columnWidth, conf = gs.defaultConf, cellClickHandler = function (tree,node,val,col,t) {
Placeholder
has 44 functions (exceeds 20 allowed). Consider refactoring. Open
class Placeholder(models.Model):
"""
Attributes:
is_static Set to "True" for static placeholders by the template tag
is_editable If False the content of the placeholder is not editable in the frontend
Function _get_editable_context
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def _get_editable_context(self, context, instance, language, edit_fields,
view_method, view_url, querystring, editmode=True):
"""
Populate the context with the requested attributes to trigger the change form
"""
- 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 initContainer
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
initContainer: function () {
var selector = ".select2-choices", selection;
this.searchContainer = this.container.find(".select2-search-field");
Function _drag
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drag(elem = this.ui.sortables) {
var that = this;
elem
.nestedSortable({
Function initContainer
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
initContainer: function () {
var selection,
container = this.container,
dropdown = this.dropdown,
Function prepareOpts
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
prepareOpts: function (opts) {
var element, select, idKey, ajaxUrl, self = this;
element = opts.element;
Function validate_templates
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def validate_templates(self, plugin=None):
"""
Plugins templates are validated at this stage
"""
if plugin:
- 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
Plugin
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
var Plugin = new Class({
implement: [Helpers],
options: {
type: '', // bar, plugin or generic
File page_permissions.py
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
from functools import wraps
from cms.api import get_page_draft
from cms.cache.permissions import get_permission_cache, set_permission_cache
from cms.constants import GRANT_ALL_PERMISSIONS
File toolbar.py
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
import functools
import operator
from collections import OrderedDict
from classytags.utils import flatten_context
Function change_language_menu
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def change_language_menu(self):
if self.toolbar.edit_mode_active and self.page:
can_change = page_permissions.user_can_change_page(
user=self.request.user,
page=self.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
File plugin_base.py
has 388 lines of code (exceeds 250 allowed). Consider refactoring. Open
import json
import re
from django import forms
from django.contrib import admin, messages
Function _drag
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
_drag(elem = this.ui.sortables) {
var that = this;
elem
.nestedSortable({
- 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 add_plugin
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def add_plugin(placeholder, plugin_type, language, position='last-child',
target=None, **data):
"""
Add a plugin to a placeholder
- 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_vary_cache_on
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def get_vary_cache_on(self, request):
"""
Returns a list of VARY headers.
"""
def inner_plugin_iterator(lang):
- 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 handleMovePlugin
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
handleMovePlugin(data) {
if (data.plugin_parent) {
if (data.plugin_id) {
const draggable = $(`.cms-draggable-${data.plugin_id}:last`);
- 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 exports
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(opts) {
'use strict';
var PROJECT_PATH = opts.PROJECT_PATH;
var CMS_VERSION = opts.CMS_VERSION;
File cms_menus.py
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django.db.models.query import Prefetch, prefetch_related_objects
from django.urls import reverse
from django.utils.functional import SimpleLazyObject
from django.utils.translation import override as force_language
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,