Showing 126 of 199 total issues
Function _acm_scoreboard
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def _acm_scoreboard(is_export, _, tdoc, ranked_tsdocs, udict, dudict, pdict):
columns = []
columns.append({'type': 'rank', 'value': _('Rank')})
columns.append({'type': 'user', 'value': _('User')})
columns.append({'type': 'display_name', 'value': _('Display 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 request
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
pjax.request = async opt => {
const options = {
method: 'get',
push: true,
...opt,
File domain.py
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
import datetime
from pymongo import errors
from pymongo import ReturnDocument
Function page
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
const page = new NamedPage('domain_manage_role', () => {
const createRoleDialog = new ActionDialog({
$body: $('.dialog__body--create-role > div'),
onDispatch(action) {
const $role = createRoleDialog.$dom.find('[name="role"]');
Function reducer
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function reducer(state = {}, action) {
switch (action.type) {
case 'DIALOGUES_LOAD_DIALOGUES_FULFILLED': {
const dialogues = action.payload.messages;
return _.fromPairs(_.map(dialogues, d => [d._id, false]));
Function buildBodyData
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
buildBodyData() {
const now = moment();
const days = [];
{
// back fill
- 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 _assignment_scoreboard
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def _assignment_scoreboard(is_export, _, tdoc, ranked_tsdocs, udict, dudict, pdict):
columns = []
columns.append({'type': 'rank', 'value': _('Rank')})
columns.append({'type': 'user', 'value': _('User')})
columns.append({'type': 'display_name', 'value': _('Display 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 render
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<Toolbar>
<ToolbarButton
disabled={this.props.isPosting || !this.props.pretestValid}
File home.py
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import hmac
import itertools
from bson import objectid
File problem.py
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
import collections
import datetime
import itertools
import random
from bson import objectid
File error.py
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
from vj4.model import builtin
class Error(Exception):
pass
Function switchToTab
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
async switchToTab(idx) {
if (idx === this.currentIndex) {
return;
}
if (this.isAnimating) {
Function load
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
async function load() {
const loadSequence = [
...buildSequence(includedPages, 'before'),
...buildSequence([currentPage], 'before'),
...buildSequence(includedPages, 'after'),
- 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 buildBody
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildBody() {
const data = this.buildBodyData();
const $body = $('<div class="calendar__body"></div>');
data.forEach(week => {
const $row = $(tpl`<div class="calendar__row">
Function render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<Panel
title={(
<span>
Function printLiteralOrObject
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function printLiteralOrObject(v) {
if (typeof v === 'number') {
print(String(v));
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 smoothScrollPage
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const smoothScrollPage = new AutoloadPage('smoothScrollPage', null, () => {
const HISTORY_SUPPORT = !!(typeof window.history === 'object' && window.history.pushState);
const ANCHOR_REGEX = /^#[^ ]+$/;
const OFFSET_HEIGHT = 10 + ($('.nav').height() || 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 multipart_argument
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def multipart_argument(coro):
@functools.wraps(coro)
async def wrapped(self, **kwargs):
file_ids = list()
try:
- 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 page
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const page = new NamedPage('domain_manage_role', () => {
const createRoleDialog = new ActionDialog({
$body: $('.dialog__body--create-role > div'),
onDispatch(action) {
const $role = createRoleDialog.$dom.find('[name="role"]');
- 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 reducer
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function reducer(state = {}, action) {
switch (action.type) {
case 'DIALOGUES_LOAD_DIALOGUES_FULFILLED': {
const dialogues = action.payload.messages;
return _.fromPairs(_.map(dialogues, d => [d._id, '']));