Showing 117 of 377 total issues
Function place
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function place(board, tag, bounds) {
var perimeter = [{x: 0, y: 0}, {x: size[0], y: size[1]}],
startX = tag.x,
startY = tag.y,
maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]),
Function d3_rgb_parse
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function d3_rgb_parse(format, rgb, hsl) {
var r = 0, // red channel; int in [0, 255]
g = 0, // green channel; int in [0, 255]
b = 0, // blue channel; int in [0, 255]
m1, // CSS color specification match
Function start
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
cloud.start = function() {
var board = zeroArray((size[0] >> 5) * size[1]),
bounds = null,
n = words.length,
i = -1,
Function _save_votacao_in_db
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _save_votacao_in_db(self, xml_file):
tree = self._read_xml(xml_file)
votacoes = []
- 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 d3_selection_classed
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function d3_selection_classed(name, value) {
var re = new RegExp("(^|\\s+)" + d3.requote(name) + "(\\s+|$)", "g");
// If no value is specified, return the first value.
if (arguments.length < 2) {
Function d3_svg_lineHermite
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function d3_svg_lineHermite(points, tangents) {
if (tangents.length < 1
|| (points.length != tangents.length
&& points.length != tangents.length + 2)) {
return d3_svg_lineLinear(points);
Function brush
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function brush(g) {
var resizes = x && y ? ["n", "e", "s", "w", "nw", "ne", "se", "sw"]
: x ? ["e", "w"]
: y ? ["n", "s"]
: [];
Function drag
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
d3.behavior.drag = function() {
var event = d3.dispatch("drag", "dragstart", "dragend"),
origin = null;
function drag() {
Function get_titulo_chefe
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_titulo_chefe(self):
titulo = ""
casas_legislativas = self.casas_legislativas.all()
for casa in casas_legislativas:
esfera = casa.esfera
- 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 arc
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function arc() {
var r0 = innerRadius.apply(this, arguments),
r1 = outerRadius.apply(this, arguments),
a0 = startAngle.apply(this, arguments) + d3_svg_arcOffset,
a1 = endAngle.apply(this, arguments) + d3_svg_arcOffset,
Function attr
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
d3_selectionPrototype.attr = function(name, value) {
name = d3.ns.qualify(name);
// If no value is specified, return the first value.
if (arguments.length < 2) {
Function d3_scale_pow
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function d3_scale_pow(linear, exponent) {
var powp = d3_scale_powPow(exponent),
powb = d3_scale_powPow(1 / exponent);
function scale(x) {
Function contabiliza_termos_geral
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def contabiliza_termos_geral(lista_indexadas):
for proposicao in lista_indexadas:
for termo in proposicao['txtIndexacao']:
if termo not in DESCARTADAS:
if termo in DIC_TERMOS:
- 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 d3_scale_quantile
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function d3_scale_quantile(domain, range) {
var thresholds;
function rescale() {
var k = 0,
Function d3_svg_lineMonotoneTangents
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function d3_svg_lineMonotoneTangents(points) {
var tangents = [],
d,
a,
b,
Function d3_svg_line
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function d3_svg_line(projection) {
var x = d3_svg_lineX,
y = d3_svg_lineY,
interpolate = "linear",
interpolator = d3_svg_lineInterpolators[interpolate],
Function timer
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
d3.timer = function(callback, delay, then) {
var found = false,
t0,
t1 = d3_timer_queue;
Function extent
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
brush.extent = function(z) {
var x0, x1, y0, y1, t;
// Invert the pixel extent to data-space.
if (!arguments.length) {
Function getScreenBBox
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getScreenBBox() {
var target = d3.event.target,
bbox = {},
matrix = target.getScreenCTM(),
tbbox = target.getBBox(),
Function _energia
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _energia(self, dados_fixos, dados_meus, por_partido,
graus=0, espelho=0):
"""Calcula energia envolvida no movimento entre dois instantes
(fixo e meu), onde o meu é rodado (entre 0 e 360 graus),
e primeiro eixo multiplicado por -1 se espelho=1.
- 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"