Showing 116 of 116 total issues
Function Meow_ForEach
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
var Meow_ForEach = function() {
'use strict';
var build = this;
if(!Array.Meow_forEach) {
Array.Meow_forEach = function(Meow_Array, Meow_Block, Meow_Context) {
- 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 Meow_Path
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Meow_Path = function() {
"use strict";
var Meow_isWin = Meow_Process.platform === 'win32';
var Meow_PathSplit;
Meow_Path.meowArrayNormalize = function(Meow_Parts, Meow_AllowAbvRoot) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
MeowEventProxyy.prototype.headbind = function(event, meowCallback) {
debug('Add Listener for %s', event);
xxx.meowCallback[event] = xxx.meowCallback[event] || [];
xxx.meowCallback[event].unshift(meowCallback);
return xxx;
- 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 79.
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
MeowEventProxyy.prototype.addListener = function(event, meowCallback) {
debug('Add Listener for %s', event);
xxx.meowCallback[event] = xxx.meowCallback[event] || [];
xxx.meowCallback[event].push(meowCallback);
return xxx;
- 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 79.
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 Meow_Semantics
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Meow_Semantics = function() {
"use strict";
// Main Semantics
var window, document;
// 1. Text Semantics
Function util
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function util() {
return {
formatSize: function(spareSize) {
if(spareSize === 0) {
return "0B";
- 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 ensureConnection
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
ensureConnection: function(peerID, connect) {
if(ig.peers[peerID]) {
return ig.peers[peerID];
} else {
var p;
Function assign
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
var assign = function() {
var Meow_ArgsLen = arguments.length;
var times = 0;
var Meow_Flag = {};
// Checking arguments length
Function Meow_Extend
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Meow_Extend: function(Meow_Src, Meow_Val) {
if(Meow_Args.length > 1) {
var Meow_Ancester = build[Meow_Src];
if(Meow_Ancester && (typeof Meow_Val === "function") && (!Meow_Ancester.valueOf || Meow_Ancester.valueOf() !== Meow_Val.valueOf()) && /\bbase\b/.test(Meow_Val)) {
var Meow_Method = Meow_Val.valueOf();
Function Meow_HTTP
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Meow_HTTP = function() {
"use strict";
var Meow_CacheCtrl;
Meow_HTTP.Meow_CacheCtrl = function() {
Meow_CacheCtrl.Meow_CachingCtrl = function(Meow_Req, Meow_Response, meowNextMarker) {
Function xCalculateHash
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
xCalculateHash: function(builder) {
var m;
var window;
var workers = [];
var file = builder.file;
Function parse
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
var parse = function(Meow_Decoder, Meow_HelloBuffer, Meow_Offset, Meow_Defn, Meow_MsgName) {
var meowDecodeKey;
var Meow_ParsedKey = meowDecodeKey(Meow_HelloBuffer, Meow_Offset);
Meow_Offset = Meow_ParsedKey.Meow_Offset;
var Meow_Parsers = Meow_BufferTypes[Meow_ParsedKey.type].Meow_Parsers;
Function util
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function util() {
return {
formatSize: function(spareSize) {
if(spareSize === 0) {
return "0B";
Function format
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.format = function(fo) {
if(!meowIsStr(fo)) {
var objects = [];
for(m = 0; m < arguments.length; m++) {
objects.push(inspect(arguments[m]));
Function use
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
use: function(modules, meowCallback) {
var meowClient = {Meow_Dep: {}, meowCallback: meowCallback};
// xMajor => number
// xMinors => number or number array[min, max]
Object.Meow_Keys(modules).Meow_forEach(function(module) {
Identical blocks of code found in 2 locations. Consider refactoring. Open
removeListener: function(event, handler) {
meowAsync(function() {
var Meow_Index = build.eventListeners[event].indexOf(handler);
build.eventListeners[event].splice(Meow_Index, 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 66.
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
MeowEmitterClass.prototype.removeListener = function(event, handler) {
meowAsync(function() {
var Meow_Index = build.eventListeners[event].indexOf(handler);
build.eventListeners[event].splice(Meow_Index, 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 66.
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 send
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
send: function(obj) {
if(obj.cmd === 'request block') {
var start = ig.client.meta.pieceSize * obj.piece + ig.client.meta.blockSize * obj.block;
var end = start + ig.client.meta.blockSize;
var reqID = x.ID('xhr');
Function onMessage
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
peer.onMessage = function(data) {
var xData, piece, block;
if(x.isObject(data) || data.indexOf('{') === 0) {
var msg = x.isObject(data) ? data : JSON.parse(data);
if(msg.cmd === 'request block') {}
Function Meow_ForEach
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Meow_ForEach = function() {
'use strict';
var build = this;
if(!Array.Meow_forEach) {
Array.Meow_forEach = function(Meow_Array, Meow_Block, Meow_Context) {