Showing 1,229 of 1,229 total issues
Function _distributeChange
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_distributeChange: function(doc, evName, isInResult) {
var self = this;
var actuallySend = function() {
for (var socketId in self.listeners) {
var listener = self.listeners[socketId];
Function _register
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _register(msg) {
s.graph.addNode({
id: msg.name,
size: nodeRadius,
x: Math.random(),
Function accessControlQueryModifier
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function accessControlQueryModifier(clQuery, schema, userPL, op) { // guards the properties that are marked with higher required permissions for reading
var pathPs = schema.pathPermissions;
var select;
if (clQuery.select) {
select = clQuery.select[0];
Identical blocks of code found in 2 locations. Consider refactoring. Open
n.fa2 = {
mass: 1 + self.graph.degree(n.id),
old_dx: 0,
old_dy: 0,
dx: 0,
- 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 57.
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
n.fa2 = {
mass: 1 + self.graph.degree(n.id),
old_dx: 0,
old_dy: 0,
dx: 0,
- 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 57.
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 timestamp
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
, timestamp: function(name) {
return function(vals, cb) {
try {
var mapped = vals.map(function(val) {
if (val.match(/^-?[0-9]+(\.[0-9]+)?$/)) {
- 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 enter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
enter: function (n, p, c) {
// TODO if the function is used for more than the async call, we NEED to run the mapping concurrently for two fluxion : the old, and the new.
if (n.rupturePoint) {
- 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 end
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Context.prototype.end = function() {
function registerDependency(variable, flx, ref){
if (!flx.dependencies[variable.name]) {
flx.dependencies[variable.name] = {
- 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 _reducer
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function _reducer() {
function reduce(n, it) {
function _agg(n) {
- 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 d3_geom_voronoi
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function d3_geom_voronoi(sites, bbox) {
var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle;
d3_geom_voronoiEdges = [];
d3_geom_voronoiCells = new Array(sites.length);
d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree();
Function brushmove
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function brushmove() {
var point = d3.mouse(target), moved = false;
if (offset) {
point[0] += offset[0];
point[1] += offset[1];
Function d3_geo_pointInPolygon
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function d3_geo_pointInPolygon(point, polygon) {
var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0;
d3_geo_areaRingSum.reset();
for (var i = 0, n = polygon.length; i < n; ++i) {
var ring = polygon[i], m = ring.length;
Function setup
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup: function() {
if ( rformElems.test( this.nodeName ) ) {
// IE doesn't fire change on a check/radio until blur; trigger it on click
// after a propertychange. Eat the blur-change in special.change.handle.
Function propFilter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function propFilter( props, specialEasing ) {
var value, name, index, easing, hooks;
// camelCase, specialEasing and expand cssHook pass
for ( index in props ) {
Function bodyParser
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var bodyParser = function () {
var getRawBody = require('raw-body');
module.exports = function getRawBodyFn(limit) {
return function saveBody(req, res, next) {
getRawBody(/*msg._sign.*/req, {
Function bind
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatcher.prototype.bind = function(events, handler) {
var i,
event,
eArray;
Function unbind
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatcher.prototype.unbind = function(events, handler) {
var i,
j,
a,
event,
Function postPlaceholder
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function postPlaceholder(next, signature) {
return b.callExpression(
b.memberExpression(
b.identifier("flx"),
Function graph
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function graph(type, options) {
this._options = options;
this._output_pre = _bgraph + "\\begin{" + type + "}";
this._output_post = "\\end{" + type + "}\n"+ _egraph;
this._plots = [];
Identical blocks of code found in 4 locations. Consider refactoring. Open
try {
var hooks = require('./hooks')
} catch(err) {
// For debug purpose
// console.log("No hooks module found, fallback to debug");
- 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