Showing 301 of 580 total issues
Function getRenderCoords
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
Edge.prototype.getRenderCoords = function(fromOffsetPx, toOffsetPx, display, forward) {
var fromOffsetX, fromOffsetY;
var isBase = (fromOffsetPx === 0 && toOffsetPx === 0);
if (!this.baseRenderCoords && !isBase) {
Function Place
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Place = augment(Point, function(base) {
/**
* the constructor
*/
Function Stats
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Stats = function () {
var startTime = Date.now()
var prevTime = startTime
var ms = 0
var msMin = Infinity
Function exports
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (schema, options) {
/**
* Add address and coordinate fields
*/
Function setAddress
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Plan.prototype.setAddress = function (name, locationData, callback) {
callback = callback || function () {} // noop callback
if (
!locationData &&
(
Function apply2DOffsets
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
NetworkGraph.prototype.apply2DOffsets = function() {
this.initComparisons();
var alignmentBundles = {}; // maps alignment ID to array of range-bounded bundles on that alignment
- 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 updateRoutes
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateRoutes (plan, opts, callback) {
opts = opts || {}
const done = function (err, res) {
if (err) {
Function View
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
var View = view(require('./template.html'), function (view, model) {
var scorer = new ProfileScorer()
view.on('rendered', function () {
try {
Function end
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Request.prototype.end = function(fn){
var self = this;
var xhr = this.xhr = request.getXHR();
var query = this._query.join('&');
var timeout = this._timeout;
- 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
File index.js
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
var convert = require('../convert')
var model = require('component-model')
var defaults = require('../components/segmentio/model-defaults/0.2.0')
var each = require('component-each')
Function load
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Network.prototype.load = function(data) {
debug('loading', data);
var self = this;
// check data
Function Point
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
var Point = augment(Object, function() {
this.constructor = function(data) {
for (var key in data) {
this[key] = data[key];
- 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
File index.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Dependencies
*/
var augment = require('augment');
Function journeys
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
const journeys = options.reduce(function (journeys, option, optionIndex) {
// handle non-transit option as a special case
if (!option.transit) {
// create separate journey for each non-transit mode contained in this option
return journeys.concat(option.access.map(function (leg) {
File profile-to-transitive.js
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Convert OTP data into a consumable format
*
* @param {Object} options
* @return {Object} data
Function exports
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(reactive){
/**
* Generate attribute bindings.
*/
Function SegmentLabel
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
var SegmentLabel = augment(Label, function(base) {
this.constructor = function(parent, text) {
base.constructor.call(this, parent);
Function exports
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(points) {
var newPoints, i, r;
// determine if we need to resample the path (i.e. place new points at a regular
// interval for marker-based styling) based on styler settings
- 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 addSegmentsToQuadtree
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.addSegmentsToQuadtree = function() {
var disp = this.transitive.display;
this.transitive.renderSegments.forEach(function(segment) {
Function apply2DOffsets
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
NetworkGraph.prototype.apply2DOffsets = function() {
this.initComparisons();
var alignmentBundles = {}; // maps alignment ID to array of range-bounded bundles on that alignment