Showing 374 of 374 total issues
Function 48
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],48:[function(require,module,exports){
(function (global){
/*global Blob,File*/
/**
Function 26
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
},{"../transport":21,"component-inherit":28,"debug":9,"engine.io-parser":29,"parseqs":39,"xmlhttprequest":27}],26:[function(require,module,exports){
/**
* Module dependencies.
*/
- 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 onPartialStatus
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
'onPartialStatus': function(status) {
//console.warn('partial status', status);
switch (status && status.what) {
case 'agent':
update.call(this, this.agents);
Function onPartialStatus
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
'onPartialStatus': function(status) {
//console.warn('partial status', status);
switch (status && status.what) {
case 'agent':
update.call(this, this.agents);
Function applyMask
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function applyMask(mask) {
var x, y, r3x, r3y;
switch (mask) {
case 0:
Function setDomNodeChildrenFromArrayMapping
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
ko.utils.setDomNodeChildrenFromArrayMapping = function (domNode, array, mapping, options, callbackAfterAddingNodes) {
// Compare the provided array against the previous one
array = array || [];
options = options || {};
var isFirstExecution = ko.utils.domData.get(domNode, lastMappingResultDomDataKey) === undefined;
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (build && tab != "info" && !build.conf.platform.findOne(function(platform) {
return platform == tab;
})) {
selectedTab("#info");
} else if (build) {
- 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 102.
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
if (build && tab != "info" && !build.conf.platform.findOne(function(platform) {
return platform == tab;
})) {
selectedTab("#info");
} else if (build) {
- 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 102.
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
Function evaluateImmediate
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
function evaluateImmediate(suppressChangeNotification) {
if (_isBeingEvaluated) {
if (pure) {
throw Error("A 'pure' computed must not be called recursively");
}
Function applyBindingsToNodeInternal
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
function applyBindingsToNodeInternal(node, sourceBindings, bindingContext, bindingContextMayDifferFromDomParentElement) {
// Prevent multiple applyBindings calls for the same node, except when a binding value is specified
var alreadyBound = ko.utils.domData.get(node, boundElementDomDataKey);
if (!sourceBindings) {
if (alreadyBound) {
Function probe
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Socket.prototype.probe = function (name) {
debug('probing transport "%s"', name);
var transport = this.createTransport(name, { probe: 1 })
, failed = false
, self = this;
Function serialize
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {
var value, className, year, month, date, time, hours, minutes, seconds, milliseconds, results, element, index, length, prefix, result;
try {
// Necessary for host object support.
value = object[property];
Function 1
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
module.exports = Msg;
require('./utils');
var extend = require('extend'),
concat = Array.prototype.concat,
Function 34
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
},{}],34:[function(require,module,exports){
(function (global){
/**
* Create a blob builder even when vendor prefixes exist
*/
- 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 init
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
'init': function (element, valueAccessor, allBindings) {
var previousElementValue = element.value,
timeoutHandle,
elementValueBeforeEvent;
Function has
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function has(name) {
if (has[name] !== undef) {
// Return cached feature test result.
return has[name];
}
Function 17
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
},{}],17:[function(require,module,exports){
/**
* Expose `Emitter`.
*/
- 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 17
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],17:[function(require,module,exports){
/**
* Expose `Emitter`.
*/
Function update
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update(list) {
list.map = list.map || {};
switch (status && status.kind) {
case 'log':
var build = status.obj;
Function update
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update(list) {
list.map = list.map || {};
switch (status && status.kind) {
case 'log':
var build = status.obj;