File jquery.dataTables.min.js
has 6305 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*! DataTables 1.10.12
* ©2008-2015 SpryMedia Ltd - datatables.net/license
*/
/**
Function DataTable
has 536 lines of code (exceeds 25 allowed). Consider refactoring. Open
var DataTable = function (options) {
/**
* Perform a jQuery selector action on the table's TR elements (from the tbody) and
* return the resulting jQuery object.
* @param {string|node|jQuery} sSelector jQuery selector or node collection to act on
Function _fnScrollDraw
has 179 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnScrollDraw(settings) {
// Given that this is such a monster function, a lot of variables are use
// to try and keep the minimised size as small as possible
var scroll = settings.oScroll,
scrollX = scroll.sX,
Function _fnCalculateColumnWidths
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnCalculateColumnWidths(oSettings) {
var table = oSettings.nTable,
columns = oSettings.aoColumns,
scroll = oSettings.oScroll,
scrollY = scroll.sY,
Function _fnDraw
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnDraw(oSettings) {
/* Provide a pre-callback function which can be used to cancel the draw is false is returned */
var aPreDraw = _fnCallbackFire(oSettings, 'aoPreDrawCallback', 'preDraw', [
oSettings,
]);
Function _fnFeatureHtmlTable
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnFeatureHtmlTable(settings) {
var table = $(settings.nTable);
// Add the ARIA grid role to the table
table.attr('role', 'grid');
Function _fnBuildAjax
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnBuildAjax(oSettings, data, fn) {
// Compatibility with 1.9-, allow fnServerData and event to manipulate
_fnCallbackFire(oSettings, 'aoServerParams', 'serverParams', [data]);
// Convert to object based for 1.10+ if using the old array scheme which can
Function _fnSort
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnSort(oSettings) {
var i,
ien,
iLen,
j,
Function _
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
_: function (settings, host, idx, buttons, page, pages) {
var classes = settings.oClasses;
var lang = settings.oLanguage.oPaginate;
var aria = settings.oLanguage.oAria.paginate || {};
var btnDisplay,
Function _fnAddOptionsHtml
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnAddOptionsHtml(oSettings) {
var classes = oSettings.oClasses;
var table = $(oSettings.nTable);
var holding = $('<div/>').insertBefore(table); // Holding element for speed
var features = oSettings.oFeatures;
Function _fnAjaxParameters
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnAjaxParameters(settings) {
var columns = settings.aoColumns,
columnCount = columns.length,
features = settings.oFeatures,
preSearch = settings.oPreviousSearch,
Function _fnColumnOptions
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnColumnOptions(oSettings, iCol, oOptions) {
var oCol = oSettings.aoColumns[iCol];
var oClasses = oSettings.oClasses;
var th = $(oCol.nTh);
Function _fnGetObjectDataFn
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnGetObjectDataFn(mSource) {
if ($.isPlainObject(mSource)) {
/* Build an object of get functions, and wrap them in a single call */
var o = {};
$.each(mSource, function (key, val) {
Function _fnGetRowElements
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnGetRowElements(settings, row, colIdx, d) {
var tds = [],
td = row.firstChild,
name,
col,
Function attach
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
var attach = function (container, buttons) {
var i, ien, node, button;
var clickHandler = function (e) {
_fnPageChange(settings, e.data.action, true);
};
Function __cell_selector
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
var __cell_selector = function (settings, selector, opts) {
var data = settings.aoData;
var rows = _selector_row_indexes(settings, opts);
var cells = _removeEmpty(_pluck_order(data, rows, 'anCells'));
var allCells = $([].concat.apply([], cells));
Function iterator
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
iterator: function (flatten, type, fn, alwaysNew) {
var a = [],
ret,
i,
ien,
Function _fnSetObjectDataFn
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnSetObjectDataFn(mSource) {
if ($.isPlainObject(mSource)) {
/* Unlike get, only the underscore (global) option is used for for
* setting data since we don't know the type here. This is why an object
* option is not documented for `mData` (which is read/write), but it is
Function __column_selector
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
var __column_selector = function (settings, selector, opts) {
var columns = settings.aoColumns,
names = _pluck(columns, 'sName'),
nodes = _pluck(columns, 'nTh');
Function _fnDrawHead
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnDrawHead(oSettings, aoSource, bIncludeHidden) {
var i, iLen, j, jLen, k, kLen, n, nLocalTr;
var aoLocal = [];
var aApplied = [];
var iColumns = oSettings.aoColumns.length;
Function _fnFeatureHtmlFilter
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnFeatureHtmlFilter(settings) {
var classes = settings.oClasses;
var tableId = settings.sTableId;
var language = settings.oLanguage;
var previousSearch = settings.oPreviousSearch;
Function _fnLoadState
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnLoadState(settings, oInit) {
var i, ien;
var columns = settings.aoColumns;
if (!settings.oFeatures.bStateSave) {
Function _fnSortFlatten
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnSortFlatten(settings) {
var i,
iLen,
k,
kLen,
Function _fnCreateTr
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnCreateTr(oSettings, iRow, nTrIn, anTds) {
var row = oSettings.aoData[iRow],
rowData = row._aData,
cells = [],
nTr,
Function run
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
var run = function (s) {
var selInt = _intVal(s);
// Selector - all
if (s === '') {
Function run
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
var run = function (s) {
var fnSelector = typeof s === 'function';
if (s === null || s === undefined || fnSelector) {
// All cells and function selectors
Function _fnInitialise
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnInitialise(settings) {
var i,
iLen,
iAjaxStart = settings.iInitDisplayStart;
var columns = settings.aoColumns,
Function jqueryui
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
jqueryui: function (settings, cell, column, classes) {
$('<div/>')
.addClass(classes.sSortJUIWrapper)
.append(cell.contents())
.append(
Function __details_events
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
var __details_events = function (settings) {
var api = new _Api(settings);
var namespace = '.dt.DT_details';
var drawEvent = 'draw' + namespace;
var colvisEvent = 'column-visibility' + namespace;
Function _fnSortListener
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnSortListener(settings, colIdx, append, callback) {
var col = settings.aoColumns[colIdx];
var sorting = settings.aaSorting;
var asSorting = col.asSorting;
var nextSortIdx;
Function _fnDetectHeader
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnDetectHeader(aLayout, nThead) {
var nTrs = $(nThead).children('tr');
var nTr, nCell;
var i, k, l, iLen, jLen, iColShifted, iColumn, iColspan, iRowspan;
var bUnique;
Function _fnBuildHead
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnBuildHead(oSettings) {
var i, ien, cell, row, column;
var thead = oSettings.nTHead;
var tfoot = oSettings.nTFoot;
var createHeader = $('th, td', thead).length === 0;
Function _selector_row_indexes
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
var _selector_row_indexes = function (settings, opts) {
var i,
ien,
tmp,
a = [],
Function _fnFeatureHtmlPaginate
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnFeatureHtmlPaginate(settings) {
var type = settings.sPaginationType,
plugin = DataTable.ext.pager[type],
modern = typeof plugin === 'function',
redraw = function (settings) {
Function __row_selector
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
var __row_selector = function (settings, selector, opts) {
var run = function (sel) {
var selInt = _intVal(sel);
var i, ien;
Function _fnFilterData
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnFilterData(settings) {
var columns = settings.aoColumns;
var column;
var i, j, ien, jen, filterData, cellData, row;
var fomatters = DataTable.ext.type.search;
Function _fnGetCellData
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnGetCellData(settings, rowIdx, colIdx, type) {
var draw = settings.iDraw;
var col = settings.aoColumns[colIdx];
var rowData = settings.aoData[rowIdx]._aData;
var defaultContent = col.sDefaultContent;
Function run
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
var run = function (sel) {
var selInt = _intVal(sel);
var i, ien;
// Short cut - selector is a number and no options provided (default is
Function _fnBrowserDetect
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnBrowserDetect(settings) {
// We don't need to do this every time DataTables is constructed, the values
// calculated are specific to the browser and OS configuration which we
// don't expect to change between initialisations
if (!DataTable.__browser) {
Function _fnFilterComplete
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnFilterComplete(oSettings, oInput, iForce) {
var oPrevSearch = oSettings.oPreviousSearch;
var aoPrevSearch = oSettings.aoPreSearchCols;
var fnSaveFilter = function (oFilter) {
/* Save the filtering values */
Function _fnInvalidate
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnInvalidate(settings, rowIdx, src, colIdx) {
var row = settings.aoData[rowIdx];
var i, ien;
var cellWrite = function (cell, col) {
// This is very frustrating, but in IE if you just write directly
Function fetchData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
var fetchData = function (data, type, src) {
var arrayNotation, funcNotation, out, innerSrc;
if (src !== '') {
var a = _fnSplitObjNotation(src);
Function setData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
var setData = function (data, val, src) {
var a = _fnSplitObjNotation(src),
b;
var aLast = a[a.length - 1];
var arrayNotation, funcNotation, o, innerSrc;
Function _selector_run
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
var _selector_run = function (type, selector, selectFn, settings, opts) {
var out = [],
res,
a,
i,
Function _fnApplyColumnDefs
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnApplyColumnDefs(oSettings, aoColDefs, aoCols, fn) {
var i, iLen, j, jLen, k, kLen, def;
var columns = oSettings.aoColumns;
// Column definitions with aTargets
Function _fnFeatureHtmlLength
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnFeatureHtmlLength(settings) {
var classes = settings.oClasses,
tableId = settings.sTableId,
menu = settings.aLengthMenu,
d2 = $.isArray(menu[0]),
Function _fnPageChange
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnPageChange(settings, action, redraw) {
var start = settings._iDisplayStart,
len = settings._iDisplayLength,
records = settings.fnRecordsDisplay();
Function _fnColumnTypes
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnColumnTypes(settings) {
var columns = settings.aoColumns;
var data = settings.aoData;
var types = DataTable.ext.type.detect;
var i, ien, j, jen, k, ken;
Consider simplifying this complex logical expression. Open
if (
ie67 ||
(!userInputs &&
!scrollX &&
!scrollY &&
Function __setColumnVis
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var __setColumnVis = function (settings, column, vis) {
var cols = settings.aoColumns,
col = cols[column],
data = settings.aoData,
row,
Function _fnSortAria
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnSortAria(settings) {
var label;
var nextSort;
var columns = settings.aoColumns;
var aSort = _fnSortFlatten(settings);
Function _fnUpdateInfo
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnUpdateInfo(settings) {
/* Show information about the table */
var nodes = settings.aanFeatures.i;
if (nodes.length === 0) {
return;
Function _fnAjaxUpdateDraw
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnAjaxUpdateDraw(settings, json) {
// v1.10 uses camelCase variables, while 1.9 uses Hungarian notation.
// Support both
var compat = function (old, modern) {
return json[old] !== undefined ? json[old] : json[modern];
Function _fnFilter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnFilter(settings, input, force, regex, smart, caseInsensitive) {
var rpSearch = _fnFilterCreateSearch(input, regex, smart, caseInsensitive);
var prevSearch = settings.oPreviousSearch.sSearch;
var displayMaster = settings.aiDisplayMaster;
var display, invalidated, i;
Function extend
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_Api.extend = function (scope, obj, ext) {
// Only extend API instances and static properties of the API
if (!ext.length || !obj || (!(obj instanceof _Api) && !obj.__dt_wrapper)) {
return;
}
Function _addNumericSort
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _addNumericSort(decimalPlace) {
$.each(
{
// Plain numbers
num: function (d) {
Function _toSettings
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var _toSettings = function (mixed) {
var idx, jq;
var settings = DataTable.settings;
var tables = $.map(settings, function (el, i) {
return el.nTable;
Function _fnLog
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnLog(settings, level, msg, tn) {
msg =
'DataTables warning: ' +
(settings ? 'table id=' + settings.sTableId + ' - ' : '') +
msg;
Function _
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_: function (settings, cell, column, classes) {
// No additional mark-up required
// Attach a sort listener to update on sort - note that using the
// `DT` namespace will allow the event to be removed automatically
// on destroy, while the `dt` namespaced event is the one we are
Avoid deeply nested control flow statements. Open
if (arrayNotation) {
// Array notation
a[i] = a[i].replace(__reArray, '');
// Condition allows simply [] to be passed in
Function fnFilter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
sInput,
iColumn,
bRegex,
bSmart,
bShowGlobal,
Avoid deeply nested control flow statements. Open
if (typeof cellData !== 'string' && cellData.toString) {
cellData = cellData.toString();
}
Avoid deeply nested control flow statements. Open
if (
s(
o,
_fnGetCellData(settings, row, j),
host.anCells ? host.anCells[j] : null
Avoid deeply nested control flow statements. Open
if (
(tmp === -1 && search === 'removed') ||
(tmp >= 0 && search === 'applied')
) {
a.push(i);
Avoid deeply nested control flow statements. Open
for (j = 0, jen = items.length; j < jen; j++) {
item = items[j];
if (type === 'cell') {
ret = fn.call(apiInst, context[i], item.row, item.column, i, j);
Avoid deeply nested control flow statements. Open
if (!detectedType && j !== types.length - 1) {
break;
}
Avoid deeply nested control flow statements. Open
if (cOption === aoFeatures[k].cFeature) {
featureNode = aoFeatures[k].fnInit(oSettings);
break;
}
Avoid deeply nested control flow statements. Open
if (cellData === null) {
cellData = '';
}
Avoid deeply nested control flow statements. Open
if (type === 'column-rows') {
rows = _selector_row_indexes(context[i], selector.opts);
}
Avoid deeply nested control flow statements. Open
if (detectedType === 'html') {
break;
}
Avoid deeply nested control flow statements. Open
for (k = 0; k < iRowspan; k++) {
aLayout[i + k][iColShifted + l] = {
cell: nCell,
unique: bUnique,
};
Avoid deeply nested control flow statements. Open
if (fomatters[column.sType]) {
cellData = fomatters[column.sType](cellData);
}
Avoid deeply nested control flow statements. Open
for (var j = 0, jLen = val.length; j < jLen; j++) {
o = {};
setData(o, val[j], innerSrc);
data[a[i]].push(o);
}
Avoid deeply nested control flow statements. Open
if (cache[k] === undefined) {
cache[k] = _fnGetCellData(settings, k, i, 'type');
}
Function _fnFilterColumn
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
settings,
searchStr,
colIdx,
regex,
smart,
Avoid deeply nested control flow statements. Open
while (columns.length <= aTargets[j]) {
_fnAddColumn(oSettings);
}
Function _fnFilter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function _fnFilter(settings, input, force, regex, smart, caseInsensitive) {
Function _
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
_: function (settings, host, idx, buttons, page, pages) {
Function _fnReduce
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function _fnReduce(that, fn, init, start, end, inc) {
Avoid deeply nested control flow statements. Open
if (data === null || data[a[i]] === undefined) {
return undefined;
}
Avoid deeply nested control flow statements. Open
} else if (typeof aTargets[j] === 'number' && aTargets[j] < 0) {
/* Negative integer, right to left column counting */
fn(columns.length + aTargets[j], def);
} else if (typeof aTargets[j] === 'string') {
/* Class name matching on TH element */
Avoid deeply nested control flow statements. Open
for (k = 0; k < iRowspan; k++) {
aApplied[i + k][j + iColspan] = 1;
}
Consider simplifying this complex logical expression. Open
if (
nCell.nodeName.toUpperCase() === 'TD' ||
nCell.nodeName.toUpperCase() === 'TH'
) {
/* Get the col and rowspan attributes from the DOM and sanitise them */
Function number
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
number: function (thousands, decimal, precision, prefix, postfix) {
Function _selector_run
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var _selector_run = function (type, selector, selectFn, settings, opts) {
Function fnUpdate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
this.fnUpdate = function (mData, mRow, iColumn, bRedraw, bAction) {
Function __columnData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var __columnData = function (settings, column, r1, r2, rows) {
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return [rowObj.idx];
Avoid too many return
statements within this function. Open
return [sel._DT_CellIndex.row];
Avoid too many return
statements within this function. Open
return host.length ? [host.data('dt-row')] : [];
Avoid too many return
statements within this function. Open
return [sel._DT_RowIndex]; // Property added by DT for fast lookup
Avoid too many return
statements within this function. Open
return host.length ? [host.data('dt-column')] : [];
Avoid too many return
statements within this function. Open
return [_fnVisibleToColumnIndex(settings, idx)];
Avoid too many return
statements within this function. Open
return [s._DT_CellIndex.column];
Avoid too many return
statements within this function. Open
return jqResult;
Avoid too many return
statements within this function. Open
return function (data, type) {
// row and meta also passed, but not used
return data[mSource];
};
Avoid too many return
statements within this function. Open
return function (data, val) {
// meta is also passed in, but not used
data[mSource] = val;
};
Avoid too many return
statements within this function. Open
return jq
.map(function (i) {
idx = $.inArray(this, tables);
return idx !== -1 ? settings[idx] : null;
})
Avoid too many return
statements within this function. Open
return $(nodes)
.filter(sel)
.map(function () {
return this._DT_RowIndex;
})
Similar blocks of code found in 2 locations. Consider refactoring. Open
_api_register('columns()', function (selector, opts) {
// argument shifting
if (selector === undefined) {
selector = '';
} else if ($.isPlainObject(selector)) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 145.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
_api_register('rows()', function (selector, opts) {
// argument shifting
if (selector === undefined) {
selector = '';
} else if ($.isPlainObject(selector)) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 145.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
} else if (
typeof mSource === 'string' &&
(mSource.indexOf('.') !== -1 ||
mSource.indexOf('[') !== -1 ||
mSource.indexOf('(') !== -1)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 62.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
} else if (
typeof mSource === 'string' &&
(mSource.indexOf('.') !== -1 ||
mSource.indexOf('[') !== -1 ||
mSource.indexOf('(') !== -1)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 62.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
$.extend({}, settings.oPreviousSearch, {
sSearch: input + '',
bRegex: regex === null ? false : regex,
bSmart: smart === null ? true : smart,
bCaseInsensitive: caseInsen === null ? true : caseInsen,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 56.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
$.extend(preSearch[column], {
sSearch: input + '',
bRegex: regex === null ? false : regex,
bSmart: smart === null ? true : smart,
bCaseInsensitive: caseInsen === null ? true : caseInsen,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 56.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
_api_register('ajax.params()', function () {
var ctx = this.context;
if (ctx.length > 0) {
return ctx[0].oAjaxData;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 56.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
_fnApplyToChildren(function (nSizer, i) {
nSizer.innerHTML =
'<div class="dataTables_sizing" style="height:0;overflow:hidden;">' +
headerContent[i] +
'</div>';
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 56.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
_api_register('ajax.json()', function () {
var ctx = this.context;
if (ctx.length > 0) {
return ctx[0].json;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 56.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
_fnApplyToChildren(function (nSizer, i) {
nSizer.innerHTML =
'<div class="dataTables_sizing" style="height:0;overflow:hidden;">' +
footerContent[i] +
'</div>';
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 56.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
_fnApplyToChildren(function (nSizer) {
headerContent.push(nSizer.innerHTML);
headerWidths.push(_fnStringToCss($(nSizer).css('width')));
}, headerSrcEls);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
_fnApplyToChildren(function (nSizer) {
footerContent.push(nSizer.innerHTML);
footerWidths.push(_fnStringToCss($(nSizer).css('width')));
}, footerSrcEls);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
function _fnSearchToHung(obj) {
return {
sSearch: obj.search,
bSmart: obj.smart,
bRegex: obj.regex,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 53.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
$(_div, { class: classes.sScrollFootInner }).append(
footerClone
.removeAttr('id')
.css('margin-left', 0)
.append(captionSide === 'bottom' ? caption : null)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 53.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
$(_div, { class: classes.sScrollHeadInner })
.css({
'box-sizing': 'content-box',
width: scroll.sXInner || '100%',
})
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 53.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
function _fnSearchToCamel(obj) {
return {
search: obj.sSearch,
smart: obj.bSmart,
regex: obj.bRegex,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 53.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
_api_registerPlural('columns().footer()', 'column().footer()', function (
selector,
opts
) {
return this.iterator(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 51.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
_api_registerPlural('columns().header()', 'column().header()', function (
selector,
opts
) {
return this.iterator(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 51.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
case 'last':
btnDisplay = lang.sLast;
btnClass =
button +
(page < pages - 1 ? '' : ' ' + classes.sPageButtonDisabled);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 49.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
case 'next':
btnDisplay = lang.sNext;
btnClass =
button +
(page < pages - 1 ? '' : ' ' + classes.sPageButtonDisabled);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 49.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (data === undefined) {
// Get
return ctx.length && this.length
? ctx[0].aoData[this[0]]._aData
: undefined;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 47.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (data === undefined) {
// get
return ctx.length && this.length
? ctx[0].aoData[this[0]]._details
: undefined;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 47.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
case 'previous':
btnDisplay = lang.sPrevious;
btnClass =
button +
(page > 0 ? '' : ' ' + classes.sPageButtonDisabled);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 45.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
fnRecordsTotal: function () {
return _fnDataSource(this) === 'ssp'
? this._iRecordsTotal * 1
: this.aiDisplayMaster.length;
},
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 45.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
case 'first':
btnDisplay = lang.sFirst;
btnClass =
button +
(page > 0 ? '' : ' ' + classes.sPageButtonDisabled);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 45.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
fnRecordsDisplay: function () {
return _fnDataSource(this) === 'ssp'
? this._iRecordsDisplay * 1
: this.aiDisplay.length;
},
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 45.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76