Showing 350 of 970 total issues
Function prompt
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
prompt: function(identifier, errors) {
var
$field = module.get.field(identifier),
$fieldGroup = $field.closest($group),
$prompt = $fieldGroup.children(selector.prompt),
Function parameter
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
parameter: function(name, value, append) {
var i, params;
if (value !== UNDEFINED) {
var names = this.parameterNames();
params = [];
Function parseRange
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseRange(index, dimSize) {
if (index.indexOf(':') >= 0) {
// Range indexing;
var res = index.split(/\s*:\s*/);
Function reformSetting
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function reformSetting() {
// Settings of log label base
logLabelBase = custOpts.logLabelBase;
if (logLabelBase == null) {
logLabelMode = 'plain';
Function scrollPosition
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
scrollPosition: function($item, forceScroll) {
var
edgeTolerance = 5,
hasActive,
offset,
Function error
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
error: function(xhr, status, httpMessage) {
var
errorMessage = (settings.error[status] !== undefined)
? settings.error[status]
: httpMessage,
Function argmax
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
argmax : kwargs((function () {
function withAxis(data, source, offsetStride, axisSize, stride) {
var cursor = 0;
for (var offset = 0; offset < this._size; offset+=offsetStride) {
for (var i = 0; i < stride; i++) {
Function _mercator
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _mercator() {
var radians = Math.PI / 180;
var scale = 500;
var translate = [480, 250];
Function repeat
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
repeat : kwargs(function (repeats, axis, out) {
var shape;
// flattened input array
if (typeof(axis) === 'undefined') {
shape = [this._size];
Function argmin
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
argmin : kwargs((function () {
function withAxis(data, source, offsetStride, axisSize, stride) {
var cursor = 0;
for (var offset = 0; offset < this._size; offset+=offsetStride) {
for (var i = 0; i < stride; i++) {
Function ribbon
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ribbon(zr, oldShape, newShape, duration, easing) {
if (!oldShape) { // add
oldShape = {
style : {
source0 : 0,
Function reset
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
reset: function() {
$field
.each(function () {
var
$field = $(this),
Function loadLiquidFillGauge
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
function loadLiquidFillGauge(elementId, value, config) {
if(config == null) config = liquidFillGaugeDefaultSettings();
var gauge = d3.select("#" + elementId);
var radius = Math.min(parseInt(gauge.style("width")), parseInt(gauge.style("height")))/2;
- 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 setPiece
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var setPiece = function (axis, offset) {
var range = ranges[axis];
var stride = strides[axis];
if (axis < len-1) {
if (range[2] > 0) {
Function estado_de_obra
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def estado_de_obra(request):
if request.method != 'POST':
return JsonResponse({'error': 'Método inválido.'}, status=405)
estado = request.POST.get('estado')
Function parseSrcSize
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseSrcSize(json, specialArea) {
specialArea = specialArea || {};
convertorParse.xmin = 360;
convertorParse.xmax = -360;
convertorParse.ymin = 180;
Function line
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function line(zr, oldShape, newShape, duration, easing) {
if (!oldShape) {
oldShape = {
style : {
xStart : newShape.style.xStart,
Function agregarUbicacion
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$control.agregarUbicacion = function () {
var selected = [];
if (!$control.selected.departamento) {
return;
}
Function _initEvents
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
CBPGridGallery.prototype._initEvents = function() {
var self = this;
// open the slideshow when clicking on the main grid items
this.gridItems.forEach( function( item, idx ) {
Function sort
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
sort : kwargs(function (axis, order) {
if (axis < 0) {
axis = this._shape.length + axis;
}
var compareFunc;