Showing 301 of 580 total issues
Function pathtoRegexp
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function pathtoRegexp (path, keys, options) {
if (keys && !Array.isArray(keys)) {
options = keys;
keys = null;
}
Function updateTable
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
View.prototype.updateTable = function () {
var users = this.users || []
var fromDate = moment(this.fromDatePicker.getDate())
var toDate = moment(this.toDatePicker.getDate())
- 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 Labeler
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
var Labeler = augment(Object, function() {
this.constructor = function(transitive) {
this.transitive = transitive;
- 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 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (r5) {
const routeIdxToId = {}
r5.patterns.forEach((pattern) => {
routeIdxToId[pattern.routeIdx] = pattern.routeId
})
Function requestPlan
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.requestPlan = function (plan) {
if (config.r5 || process.env.TEST_R5_URL) {
const r5Url = config.r5 ? config.r5.url : process.env.TEST_R5_URL
const timezoneName = geoTz.tz(plan.from.lat, plan.from.lon)
if (!timezoneName) {
File index.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
var filePicker = require('component-file-picker')
var parse = require('csv-parse/lib/sync')
var L = require('leaflet')
require('leaflet.markercluster')
Function itinerary
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
View.prototype.itinerary = function () {
var access = this.model.access()[0]
var egress = this.model.egress()
var segments = this.model.transit()
var length = segments.length
Function exports
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
var View = module.exports = view(require('./template.html'), function (view, plan) {
plan.on('change', function (name) {
view.resetIcons()
if (name === 'from') view.find('#from-location').value = plan.from()
Function getGeometricCoords
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Edge.prototype.getGeometricCoords = function(fromOffsetPx, toOffsetPx, display, forward) {
var coords = [], lastX = null, lastY = null;
// reverse the coords array if needed
var geomCoords = forward ? this.geomCoords : this.geomCoords.concat().reverse();
Function focusPath
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.focusPath = function(path) {
var self = this;
var pathRenderedSegments = [];
var graph = this.transitive.network.graph;
Function mergeVertices
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
NetworkGraph.prototype.mergeVertices = function(vertexArray) {
var xTotal = 0,
yTotal = 0;
var vertexGroups = {
Function exports
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (route, opts) {
opts = opts || {}
var accessMode = route.access()[0].mode.toLowerCase()
Function send
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Request.prototype.send = function(data){
var obj = isObject(data);
var type = this.getHeader('Content-Type');
// merge
- 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 constructMergedMarker
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.constructMergedMarker = function(display) {
var dataArray = this.getRenderDataArray();
var xValues = [],
yValues = [];
Function generateQuery
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Plan.prototype.generateQuery = function () {
var from = this.from_ll() || {}
var to = this.to_ll() || {}
// Transit modes
Function calculateGeometry
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Edge.prototype.calculateGeometry = function(cellSize, angleConstraint) {
//if(!this.hasTransit()) angleConstraint = 5;
angleConstraint = angleConstraint || 45;
this.angleConstraintR = angleConstraint * Math.PI / 180;
Function Journey
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Journey(data, network) {
this.network = network;
for (var key in data) {
Function MemoryStats
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
var MemoryStats = function () {
var msMin = 100
var msMax = 0
var performance = window.performance
- 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 intersect
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
RenderedEdge.prototype.intersect = function(rEdge) {
// do no intersect adjacent edges of unequal bundle size
if (this.graphEdge.renderedEdges.length !== rEdge.graphEdge.renderedEdges.length) 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 getDomains
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getDomains(display, height, width, bounds, options) {
var xmin = bounds[0][0],
xmax = bounds[1][0];
var ymin = bounds[0][1],
ymax = bounds[1][1];