Showing 137 of 185 total issues
Function statistics_summary_dataframe
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def statistics_summary_dataframe(
self,
normalization=1,
votes=None,
comments=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 prepare_dataframe
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def prepare_dataframe(df, id="stats-table", pc=False):
"""
Renders dataframe in a HTML table.
"""
if pc is True:
- 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 registerAllRoutes
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function registerAllRoutes(workbox) {
log('[sw] Starting service worker');
// Cache javascript
workbox.routing.registerRoute(
Function enableFadeBottomDiv
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function enableFadeBottomDiv() {
$(document).ready(function () {
var lastScrollTop = 0;
function hideLowerNav(windowWidth) {
if (windowWidth <= 550) {
Function registerElementForComponent
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function registerElementForComponent(component, elem) {
let $elem = $(elem),
name = $elem.attr('is-element'),
parts = name.split(':'),
event = 'click',
Function init
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function(options) {
var o = $.extend({
items: 1,
itemsOnPage: 1,
pages: 0,
Function create_conversation
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_conversation(
Function _appendItem
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_appendItem: function(pageIndex, opts) {
var self = this, options, $link, o = self.data('pagination'), $linkWrapper = $('<li></li>'), $ul = self.find('ul');
pageIndex = pageIndex < 0 ? 0 : (pageIndex < o.pages ? pageIndex : o.pages - 1);
Function fix_profile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def fix_profile(profile, log=lambda *args, **kwargs: None, fix=True):
profile_id = profile["id"]
email = profile["user__email"]
state = profile["state"]
gender = profile["gender"]
- 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 random_votes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def random_votes(self, users=None, probs=(0.1, 0.15, 0.25)):
"""
Cast random votes for the list of users.
Args:
- 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 moderate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def moderate(request, conversation_id, slug, board_slug):
conversation = Conversation.objects.get(id=conversation_id)
if request.method == "POST":
post_parameters = dict(request.POST)
- 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 link_kwargs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def link_kwargs(href="#", action=NOT_GIVEN, args=(), **kwargs):
kwargs = {
"href": _normalize_href(href, kwargs.pop("url_args", None), kwargs.pop("query", None)),
"class": _normalize_class(kwargs),
"up-instant": kwargs.pop("instant", True),
- 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 db_fake
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def db_fake(
Function create_comment
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_comment(self, author, content, commit=True, *, status=None, check_limits=True, **kwargs):
Function handle
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def handle(
Function sass
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def sass(ctx, theme=None, watch=False, background=False, suffix="default", minify=False):
"""
Run Sass compiler
"""
- 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 exec_watch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def exec_watch(path, func, name, watch=False, background=False, poll_time=0.5):
path = str(path)
if watch and background:
go = lambda: watch_path(path, func, name=name, poll_time=poll_time)
return exec_watch(path, go, name, background=True)
- 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 _patch_conversation_app
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _patch_conversation_app():
from ej.components import register_menu
from ej_conversations.models import Conversation
from django.utils.translation import gettext as _
from sidekick import delegate_to, lazy
- 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_annotations
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _get_annotations(self, kwargs, prefix, user):
annotations = {}
# First tag
if kwargs.pop("first_tag", False):
- 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 conversation_can_receive_channel_vote
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def conversation_can_receive_channel_vote(func):
"""
Checks if conversation is allowed to receive votes from a given channel (tool).
If conversation author signature does not have permission, a 403 error is raised.
"""
- 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"