Showing 579 of 869 total issues
Function add_modal_button
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_modal_button(self, name, url, active=False, disabled=False, extra_classes=None, extra_wrapper_classes=None,
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, queryset=None, empty_label="---------", cache_choices=False,
Function add_sideframe_button
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_sideframe_button(self, name, url, active=False, disabled=False, extra_classes=None, extra_wrapper_classes=None,
Function get_context
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_context(self, context, from_level, to_level, extra_inactive,
Function addSlugHandlers
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function addSlugHandlers(title, slug) {
if (!slug.length) {
return;
}
Function initSelection
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
opts.initSelection = opts.initSelection || function (element, callback) {
var ids = splitVal(element.val(), opts.separator);
//search in data by array of ids, storing matching items in a list
var matches = [];
opts.query({
Function _updateWithMostUsedPlugins
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_updateWithMostUsedPlugins: function _updateWithMostUsedPlugins(plugins) {
const items = plugins.find('.cms-submenu-item');
// eslint-disable-next-line no-unused-vars
const mostUsedPlugins = toPairs(pluginUsageMap).sort(([x, a], [y, b]) => a - b).reverse();
const MAX_MOST_USED_PLUGINS = 5;
Function bindPluginKeys
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var bindPluginKeys = function () {
keyboard.setContext('plugins');
keyboard.bind('escape', function () {
var plugin = $('.cms-dragitem:focus');
var area = plugin.closest('.cms-dragarea');
Function toggleColorScheme
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
toggleColorScheme: function () {
const currentTheme = this.getColorScheme();
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
if (prefersDark) {
- 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 _moveToDropdown
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_moveToDropdown(numberOfItems, part) {
if (numberOfItems <= 0) {
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 open
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
open: function open(opts) {
if (!(opts && opts.message)) {
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 __call__
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, request):
response = self.get_response(request)
language = get_language()
if hasattr(request, 'session'):
session_language = request.session.get(LANGUAGE_SESSION_KEY, 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 handle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def handle(self, *args, **options):
if options[self.subcommand_dest] in self.instances:
command = self.instances[options[self.subcommand_dest]]
if options.get('no_color'):
command.style = no_style()
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def clean(self):
data = super().clean()
if self._errors:
# Form already has errors, best to let those be
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def handle(self, *args, **options):
urls = list(
Page.objects.exclude(application_urls='').exclude(
application_urls__isnull=True
).values_list(
- 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 _move_plugin
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _move_plugin(self, request, plugin, target_language,
target_placeholder, tree_order, target_parent=None):
if not self.has_move_plugin_permission(request, plugin, target_placeholder):
message = force_str(_("You have no permission to move this plugin"))
raise PermissionDenied(message)
- 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_available_slug
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_available_slug(site, path, language, suffix='copy', modified=False, current=None):
"""
Generates slug for path.
If path is used, appends the value of suffix to the end.
"""
- 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_bound_plugins
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_bound_plugins(plugins):
get_plugin = plugin_pool.get_plugin
plugin_types_map = defaultdict(list)
plugin_ids = []
plugin_lookup = {}
- 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 has_reached_plugin_limit
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def has_reached_plugin_limit(placeholder, plugin_type, language, template=None, parent_plugin=None):
"""
Checks if placeholder has reached it's global plugin limit,
if not then it checks if it has reached it's plugin_type limit.
"""
- 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 populate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def populate(self):
# always use draft if we have a page
self.page = get_page_draft(self.request.current_page)
if not 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"