Showing 301 of 580 total issues
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.render = function(display) {
this.svgGroup = this.parent.labelSvg.append('g')
.attr('class', 'transitive-sortable')
.datum({
owner: this,
Function decode
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.decode = function(polyline) {
var currentPosition = 0;
var currentLat = 0;
Function upload
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Modal.prototype.upload = function (e) {
e.preventDefault()
var modal = this
var location = this.model.location
Function onsubmit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
closest(view.el, 'form').onsubmit = function (e) {
e.preventDefault()
// only reset addresses if needed
const newFromValue = view.find('.from input').value
Function remove
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
LocationRow.prototype.remove = function () {
var self = this
CommuterLocation.forLocation(self.model._id(), function (err, cls) {
if (err) console.error(err)
Ridepool.forLocation(self.model._id(), function (err, ridepools) {
Function annotateTransitPoints
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Network.prototype.annotateTransitPoints = function() {
var lookup = {};
this.paths.forEach(function(path) {
Function request
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const request = module.exports.request = function request (url) {
return new Promise((resolve, reject) => {
const options = {
host: otp.host,
method: 'GET',
- 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 keydownInput
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
LocationSuggest.prototype.keydownInput = function (e) {
var el = e.target
var inputGroup = e.target.parentNode
var key = e.keyCode
- 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 start
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
page.start = function(options) {
options = options || {};
if (running) return;
running = true;
if (false === options.dispatch) dispatch = false;
- 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 SegmentLabel
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
var SegmentLabel = augment(Label, function(base) {
this.constructor = function(parent, text) {
base.constructor.call(this, parent);
- 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 getMargins
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function getMargins(options) {
var margins = {
left: 0,
right: 0,
top: 0,
- 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 send
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
module.exports.send = function send (options, callback, template) {
if (process.env.NODE_ENV === 'test') {
if (options.to.email && options.template) {
return callback(null, {
_id: '123',
- 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 Context
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function Context(path, state) {
if ('/' === path[0] && 0 !== path.indexOf(base)) path = base + (hashbang ? '#!' : '') + path;
var i = path.indexOf('?');
this.canonicalPath = path;
- 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 createRenderedSegments
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Network.prototype.createRenderedSegments = function() {
this.reLookup = {};
this.renderedEdges = [];
this.renderedSegments = [];
Function creq
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const creq = http.request(options, (cres) => {
cres.setEncoding('utf8')
cres.pipe(concat((data) => {
if (cres.statusCode !== 200) {
log.error('otp:error', {
Function profile
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const profile = optionsSplitByAccessAndEgressMode.map((option) => {
if (option.transit !== null && option.transit.length > 0) {
const legs = option.transit.length
const totalWaitingTime = option.itinerary[0].waitingTime
const totalTransitTime = option.itinerary[0].transitTime
Function View
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var View = view(require('./template.html'), function (view, model) {
var fromDateInput = view.find('.fromDate')
var defaultToDate = moment()
var defaultFromDate = moment().add(-7, 'days')
Function drawGrid
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function drawGrid(display, cellSize) {
var svg = display.svg;
var xScale = display.xScale;
var yScale = display.yScale;
Function narrativeDirections
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function narrativeDirections (edges) {
if (!edges) return ''
return edges.map(function (se) {
if (!se.streetName && !se.bikeRentalOffStation) {
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.render = function(display) {
base.render.call(this, display);
if (!this.renderData) return;
this.initSvg(display);