Showing 784 of 784 total issues
Function access
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
length = elems.length,
bulk = key == null;
Function showHide
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showHide( elements, show ) {
var display, elem, hidden,
values = [],
index = 0,
length = elements.length;
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (z) {
v = y.PAGE.totalObjCountPrimed;
w = y.PAGE.totalObjSizePrimed;
s = y.PAGE.totalRequestsPrimed;
A = y.PAGE.totalSizePrimed
- 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 63.
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 {
v = y.PAGE.totalObjCount;
w = y.PAGE.totalObjSize;
s = y.PAGE.totalRequests;
A = y.PAGE.totalSize
- 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 63.
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
Method testDoRequestHtmlWithTag
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testDoRequestHtmlWithTag()
{
$html = '<!DOCTYPE html>
<html>
<head>
Function show
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
show: function(r) {
var s = "html",
q = "";
r = r || this.yscontext.defaultview;
if (this.yscontext.component_set === null) {
Function findComponentsInNode
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
findComponentsInNode: function(s, q, y) {
var r = [];
try {
r = this.findStyleSheets(s, q)
} catch (z) {
Function lint
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
lint: function(y, B, r) {
var t, w, A, u, z = (B.inline && B.inline.styles) || [],
q = B.getComponentsByType("css"),
v = [],
s = 100,
Function setOffset
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
setOffset: function( elem, options, i ) {
var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
position = jQuery.css( elem, "position" ),
curElem = jQuery( elem ),
props = {};
Function webforms
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function webforms() {
Modernizr['input'] = (function( props ) {
for ( var i = 0, len = props.length; i < len; i++ ) {
attrs[ props[i] ] = !!(props[i] in inputElem);
}
Function cleanData
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
cleanData: function( elems, /* internal */ acceptData ) {
var elem, type, id, data,
i = 0,
internalKey = jQuery.expando,
cache = jQuery.cache,
Function style
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
Function style
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
Function validateNumeric
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
var validateNumeric = function ( fields ) {
var allIsWell = true;
for (var i = 0, j = fields.length; i < j; i++) {
var el = fields[i],
Function setOffset
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
setOffset: function( elem, options, i ) {
var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
position = jQuery.css( elem, "position" ),
curElem = jQuery( elem ),
props = {};
Function cleanData
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
cleanData: function( elems, /* internal */ acceptData ) {
var elem, type, id, data,
i = 0,
internalKey = jQuery.expando,
cache = jQuery.cache,
Function webforms
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function webforms() {
Modernizr['input'] = (function( props ) {
for ( var i = 0, len = props.length; i < len; i++ ) {
attrs[ props[i] ] = !!(props[i] in inputElem);
}
Function validateNumeric
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
var validateNumeric = function ( fields ) {
var allIsWell = true;
for (var i = 0, j = fields.length; i < j; i++) {
var el = fields[i],
Consider simplifying this complex logical expression. Open
if (T && (Q === "DOMNodeInserted" || (Q === "DOMSubtreeModified" && T !== P) || (Q === "DOMAttrModified" && (O === "src" || O === "href"))) && !M[T]) {
M[T] = 1;
B.push(R)
}
Consider simplifying this complex logical expression. Open
if ( start && start[ 3 ] !== unit ) {
// Trust units reported by jQuery.css
unit = unit || start[ 3 ];
// Make sure we update the tween properties later on