Showing 301 of 580 total issues
Function refreshRenderData
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
RenderedEdge.prototype.refreshRenderData = function(display) {
if (this.graphEdge.fromVertex.x === this.graphEdge.toVertex.x &&
this.graphEdge.fromVertex.y === this.graphEdge.toVertex.y) {
this.renderData = [];
return;
- 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 bindInterpolation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Reactive.prototype.bindInterpolation = function(el, els){
// element
if (el.nodeType == 1) {
for (var i = 0; i < el.attributes.length; i++) {
- 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 createInternalVertexPoints
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Network.prototype.createInternalVertexPoints = function() {
this.internalVertexPoints = [];
for (var i in this.graph.edgeGroups) {
- 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 exports
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function ({
from,
options,
patterns,
routes,
- 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 calculateWorldLengthAndMidpoint
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Edge.prototype.calculateWorldLengthAndMidpoint = function() {
var allPoints = [this.fromVertex.point].concat(this.pointArray, [this.toVertex
.point
]);
this.worldLength = 0;
Function WireframeEdge
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
var WireframeEdge = augment(Object, function() {
this.constructor = function(edge) {
this.edge = edge;
};
Function coordAlongEdge
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Edge.prototype.coordAlongEdge = function(t, coords, display) {
if (!this.baseRenderCoords) this.calculateBaseRenderCoords(display);
if (coords.length === 2 && this.baseRenderCoords.length === 4) {
Function get
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get() {
var req = Model.request
.get(Model.url(''))
.set(Model._headers);
Function addCommuters
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
schema.statics.addCommuters = function (commuters) {
later(() => {
const commutersPerBatch = 1
const delay = 250
log.info(`adding ${commuters.length} commuters`)
Function exports
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (ctx, next) {
log('attach view')
// create lookup table mapping location IDs -> names
ctx.organization.locations = ctx.locations
Function processBikeRentalSegment
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Profiler.prototype.processBikeRentalSegment = function(edges, from, to) {
var self = this;
var preWalkEdges = [], bikeRentalEdges = [], postWalkEdges = [];
var currentLeg = preWalkEdges;
Function Request
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Request(method, url) {
var self = this;
Emitter.call(this);
this._query = this._query || [];
this.method = method;
Function exports
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (ctx, next) {
debug('render')
if (ctx.params.commuter === 'new' || !ctx.commuter) return
CommuterLocation.forCommuter(ctx.commuter.get('_id'), function (err, commuterLocations) {
Function populate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function populate(els, data) {
for (var i = 0, el; el = els[i]; i++) {
var val = data[el.getAttribute('name')];
if (val !== undefined) {
Function WireframeVertex
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var WireframeVertex = augment(Point, function(base) {
this.constructor = function(vertex) {
base.constructor.call(this, {
vertex: vertex
Function loadCommuter
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadCommuter (next) {
var commuterData = store('commuter')
var user = session.user()
if (session.commuter()) {
Function keydownInput
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
LocationSuggest.prototype.keydownInput = function (e) {
var el = e.target
var inputGroup = e.target.parentNode
var key = e.keyCode
Function processBikeRentalSegment
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processBikeRentalSegment (streetEdgeMap, edges, from, to) {
const preWalkEdges = []
const bikeRentalEdges = []
const postWalkEdges = []
let currentLeg = preWalkEdges
Function exports
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (reactive) {
reactive.bind('select-options', function (el, name, model) {
this.change(function () {
var options = this.value(name)
var list = ''
Function serialize
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function serialize(els) {
var data = {};
for (var i = 0, el; el = els[i]; i++) {
var name = el.getAttribute('name');
if (!data[name]) {