Showing 627 of 1,220 total issues
Performance
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class Performance implements CatalogDocument, Comparable<Performance> {
private static final long serialVersionUID = 1L;
@JsonIgnore
RequestListenerThread
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
Open
@Component("apiServer")
public class RequestListenerThread extends Thread {
private static final Logger LOGGER = LoggerFactory.getLogger(RequestListenerThread.class);
private static final String THREAD_NAME = "API-Server-Thread";
Function _fnSortingClasses
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnSortingClasses( oSettings )
{
var i, iLen, j, jLen, iFound;
var aaSort, sClass;
var iColumns = oSettings.aoColumns.length;
Function showDataHistoryListAccordion
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function showDataHistoryListAccordion(dataPanel, sensor, componentId, sensorId, dataType) {
var sensor = sensorsLastObsMap[sensorId];
tempSensorLastObsMap = {
Function processJsonValue
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function processJsonValue( settings, jsonValue, indentLevel, propertyName ) {
if ( typeof indentLevel === 'undefined' ) {
indentLevel = 0;
}
Function plotLineArea
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function plotLineArea(datapoints, axisx, axisy) {
var points = datapoints.points,
ps = datapoints.pointsize,
bottom = Math.min(Math.max(0, axisy.min), axisy.max),
i = 0, top, areaOpen = false,
Function defaultPrefilter
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function defaultPrefilter( elem, props, opts ) {
/*jshint validthis:true */
var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire,
anim = this,
style = elem.style,
Function fill
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fill: function() {
var d = new Date(this.viewDate),
year = d.getUTCFullYear(),
month = d.getUTCMonth(),
startYear = this.startDate !== -Infinity ? this.startDate.getUTCFullYear() : -Infinity,
Function setupTickGeneration
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setupTickGeneration(axis) {
var opts = axis.options;
// estimate number of ticks
var noTicks;
Function _fnBuildHead
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnBuildHead( oSettings )
{
var i, nTh, iLen, j, jLen;
var iThs = $('th, td', oSettings.nTHead).length;
var iCorrector = 0;
Function fnDestroy
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.fnDestroy = function ( bRemove )
{
var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
var nOrig = oSettings.nTableWrapper.parentNode;
var nBody = oSettings.nTBody;
Function send
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
send: function( headers, complete ) {
// Get a new xhr
var handle, i,
xhr = s.xhr();
Function click
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
click: function(e) {
e.preventDefault();
var target = $(e.target).closest('span, td, th');
if (target.length == 1) {
switch(target[0].nodeName.toLowerCase()) {
SearchController
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public abstract class SearchController<T extends CatalogDocument> extends CatalogBaseController implements SearchFilterResolver {
protected static final String LIST_ACTION = "list";
protected static final String EXCEL_VIEW = "excelView";
WrapperBlockingQueue
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class WrapperBlockingQueue implements BlockingQueue<Runnable> {
private final LinkedBlockingQueue<Runnable> blockingQueue;
public WrapperBlockingQueue(final int capacity) {
SentiloRequest
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class SentiloRequest {
private static final Logger LOGGER = LoggerFactory.getLogger(SentiloRequest.class);
private static final String UTF8 = "UTF-8";
Function parseDate
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
parseDate: function(date, format, language) {
if (date instanceof Date) return date;
if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)) {
var part_re = /([\-+]\d+)([dmwy])/,
parts = date.match(/([\-+]\d+)([dmwy])/g),
Function drawBar
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawBar(x, y, b, barLeft, barRight, offset, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) {
var left, right, bottom, top,
drawLeft, drawRight, drawTop, drawBottom,
tmp;
Function keydown
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
keydown: function(e){
if (this.picker.is(':not(:visible)')){
if (e.keyCode == 27) // allow escape to hide and re-show picker
this.show();
return;
Function fnUpdate
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
"fnUpdate": function ( oSettings, fnDraw ) {
var iListLength = 5;
var oPaging = oSettings.oInstance.fnPagingInfo();
var an = oSettings.aanFeatures.p;
var i, ien, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/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"