Showing 65 of 97 total issues
Function bricks
has 272 lines of code (exceeds 25 allowed). Consider refactoring. Open
var bricks = (function ($) {
var json = bricks$json;
var actions = bricks$actions;
var util = bricks$util;
var byId = util.byId;
Function bricks
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
var bricks = (function ($) {
var json = bricks$json;
var actions = bricks$actions;
var util = bricks$util;
var byId = util.byId;
- 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 bricks$json
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
var bricks$json = (function ($) {
function JsAction(js, result) {
this.js = js;
this.result = result
};
- 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
File converter.py
has 407 lines of code (exceeds 250 allowed). Consider refactoring. Open
import ast
import collections
import copy
import io
import sys
Function bricks$json
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
var bricks$json = (function ($) {
function JsAction(js, result) {
this.js = js;
this.result = result
};
Function lazy_singledispatch
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def lazy_singledispatch(func):
"""
Single-dispatch generic function decorator.
Transforms a function into a generic function, which can have different
- 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
File client.py
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
import re
from collections import UserString
from functools import singledispatch
from lazyutils import lazy
JsTranspiler
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class JsTranspiler(CClassTranspiler):
def visit_body(self, seq, indent=True):
if indent:
self.indent_up()
File core.js
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
var bricks = (function ($) {
var json = bricks$json;
var actions = bricks$actions;
var util = bricks$util;
var byId = util.byId;
Function json_codec_worker
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function json_codec_worker(json, encode) {
var decode = !encode;
var out, key;
// Don't like undefined values
Function bem_modifiers
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def bem_modifiers(base, map=None, **states):
"""
Return a list with BEM modifiers for a given class if marked states
are enabled.
- 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
File components.py
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
from functools import wraps
import bricks.html5 as t
from bricks.contrib.bem import bem_modifiers, bem_with_modifiers
from bricks.helpers import join_classes
Function bricks$actions
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
var bricks$actions = (function($) {
function statements(json) {
for (var i = 0; i < json.data.length; i++) {
bricks.exec(json.data[i]);
}
- 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 require_deep
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def require_deep(elem):
"""
Gather list of requirements by walking through all children starting
with the given element.
"""
- 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 bricks$actions
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
var bricks$actions = (function($) {
function statements(json) {
for (var i = 0; i < json.data.length; i++) {
bricks.exec(json.data[i]);
}
Function bricks_register
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def bricks_register(view_cls, *args, name=None, register=True, **kwargs):
"""
Worker function for api and program callbacks.
"""
- 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 rpc
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
bricks.rpc = function (args) {
// Initialize parameters
args = $.extend({
api: undefined,
params: {},
Function _getDialog
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _getDialog(args, action) {
args = args || {};
var dialog = args.dialog || byId(args.dialogId || 'dialog');
var content = args.dialogContent || byId(args.dialogContentId || 'dialog-content');
Function button
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def button(children=None, class_=None,
Function getFormData
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getFormData(form) {
var files = {};
var pending = {__size: 0};
var formData = {fileData: files, __pending: pending};
var params = $(form).serializeArray();