Showing 126 of 199 total issues
Function slideDown
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function slideDown($element, duration, fromCss = {}, toCss = {}) {
const originalStyl = $element.attr('style') || '';
$element.css({
position: 'absolute',
visibility: 'none',
Function _hide
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async _hide() {
this.$dom.trigger('vjDomDialogHide');
this.isAnimating = true;
$(document).off(`keyup.${this.eventNS}`);
Function connection_route
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def connection_route(prefix, name, global_route=False):
def decorate(conn):
conn.GLOBAL = global_route
async def handler(msg, session):
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 _oi_scoreboard
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _oi_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 get_setting
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_setting(self, key):
if self.has_priv(builtin.PRIV_USER_PROFILE):
if key in self.user:
return self.user[key]
if key in self.domain_user:
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const page = new NamedPage('homework_main', () => {
// Homework Calendar
if (Context.docs) {
const events = Context.docs.map(doc => ({
beginAt: doc.begin_at * 1000,
Function __init__
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self):
middlewares = []
if options.sentry_dsn:
middlewares.append(SentryMiddleware({
'dsn': options.sentry_dsn,
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<SplitPane
defaultSize={this.props.ui.main.size}
minSize={250}
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { data } = this.props;
const submitAt = parseMongoId(data._id).timestamp * 1000;
return (
<tr onClick={ev => this.handleRowClick(ev, data._id)}>
Function touch
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function touch(mtime) {
async function touchFile(file) {
const fd = await fs.open(file.path, 'a');
try {
Function handleClickRemoveSelected
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function handleClickRemoveSelected() {
const selectedUsers = ensureAndGetSelectedUsers();
if (selectedUsers === null) {
return;
}
Function onCommentClickEdit
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function onCommentClickEdit(mode, ev) {
const $evTarget = $(ev.currentTarget);
if (CommentBox.get($evTarget)) {
CommentBox
Function default
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function (env = {}) {
function eslintLoader() {
return {
loader: 'eslint-loader',
options: {
- 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 constructor
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
constructor(name, autoload, afterLoading, beforeLoading) {
if (process.env.NODE_ENV !== 'production') {
if (typeof name !== 'string' && !(name instanceof Array)) {
// eslint-disable-next-line quotes
throw new Error(`'name' should be a string or [string]`);
- 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 highlightBlocks
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
highlightBlocks: $dom => {
$dom.find('pre code').get().forEach(code => {
const $pre = $(code).parent();
$pre.addClass('syntax-hl');
if ($pre.closest('[data-syntax-hl-show-line-number]')) {
- 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 _acm_scoreboard
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _acm_scoreboard(is_export, _, tdoc, ranked_tsdocs, udict, dudict, pdict):
Function get_user_in_problem_multi
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_user_in_problem_multi(uid: int, domain_id: str, pid: document.convert_doc_id,
Function _oi_scoreboard
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _oi_scoreboard(is_export, _, tdoc, ranked_tsdocs, udict, dudict, pdict):
Function _assignment_scoreboard
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _assignment_scoreboard(is_export, _, tdoc, ranked_tsdocs, udict, dudict, pdict):
Function sanitize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def sanitize(func):
@functools.wraps(func)
def wrapped(self, **kwargs):
new_kwargs = {}
for key, value in kwargs.items():
- 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"