Showing 579 of 869 total issues
Function edit_title_fields
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def edit_title_fields(self, request, page_id, language):
page, translation = self.get_object_with_translation(
request=request,
object_id=page_id,
language=language,
- 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 copy_plugins_to_placeholder
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def copy_plugins_to_placeholder(plugins, placeholder, language=None, root_plugin=None):
plugin_pairs = []
plugins_by_id = {}
for source_plugin in get_bound_plugins(plugins):
- 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 modify
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def modify(self, request, nodes, namespace, root_id, post_cut, breadcrumb):
# only apply this modifier if we're pre-cut (since what we do is cut)
# or if no id argument is provided, indicating {% show_menu_below_id %}
if post_cut or root_id:
return nodes
- 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 copy_with_descendants
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def copy_with_descendants(self, target_node=None, position=None,
copy_permissions=True, target_site=None):
"""
Copy a page [ and all its descendants to a new location ]
"""
- 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 search
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def search(self, q, language=None, current_site_only=True):
"""Simple search function
Plugins can define a 'search_fields' tuple similar to ModelAdmin classes
"""
- 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_placeholder_fields
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def check_placeholder_fields(output):
"""
ModelAdmin instances that are using PlaceholderField fields
should be also a subclass of PlaceholderAdminMixin
"""
- 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 applications_page_check
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def applications_page_check(request, path=None):
"""Tries to find if given path was resolved over application.
Applications have higher priority than other cms pages.
"""
if path 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
Function cut_after
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def cut_after(node, levels, removed):
"""
given a tree of nodes cuts after N levels
"""
if levels == 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"
Further reading
Function validate_url_uniqueness
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def validate_url_uniqueness(site, path, language, exclude_page=None):
""" Checks for conflicting urls
"""
if '/' in path:
validate_url(path)
- 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 initialize
has 31 lines of code (exceeds 25 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();
Function monitorSource
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
monitorSource: function () {
var el = this.opts.element, observer, self = this;
el.on("change.select2", this.bind(function (e) {
if (this.opts.element.data("select2-change-triggered") !== true) {
Function defaultTokenizer
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function defaultTokenizer(input, selection, selectCallback, opts) {
var original = input, // store the original so we can compare and know if we need to tell the search to update its text
dupe = false, // check for whether a token we extracted represents a duplicate selected choice
token, // token
index, // position at which the separator was found
Function _showAndHighlightPlugin
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
_showAndHighlightPlugin(successTimeout = 200, seeThrough = false) {
// cancel show if live modus is active
if (CMS.config.mode === 'live') {
return Promise.resolve(false);
}
Function _getWidths
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getWidths() {
var that = this;
that.items = {
left: [],
Function getSettings
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
getSettings: function() {
var settings;
// use local storage or session
Function refreshContent
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
refreshContent(contentMarkup) {
this._requestcontent = null;
if (!this._loadedStructure) {
this._requeststructure = null;
}
Function processTab
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processTab(container, elt, goReverse) {
var $focussable = getFocusableElementsInContainer(container),
curElt = elt,
index, nextIndex, prevIndex, lastIndex;
Function getDistPath
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getDistPath = function(scriptFileName) {
var fileNameReplaceRegExp = new RegExp(scriptFileName + '.*$', 'gi');
if (document.currentScript) {
return document.currentScript.src.replace(fileNameReplaceRegExp, '');
Function setSettings
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
setSettings: function(newSettings) {
// merge settings
var settings = JSON.stringify($.extend({}, window.CMS.config.settings, newSettings));
// use local storage or session
Function opening
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
opening: function () {
var el, range, len;
if (this.opts.minimumResultsForSearch >= 0) {
this.showSearch(true);