Showing 301 of 580 total issues
Function Place
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
var Place = augment(Point, function(base) {
/**
* the constructor
*/
- 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 modeDescriptor
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Route.prototype.modeDescriptor = function () {
var modeStr = ''
var accessMode = this.access()[0].mode.toLowerCase()
var egressMode = this.egress() ? this.egress()[0].mode.toLowerCase() : 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 createView
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function createView (template, fn) {
if (!template) throw new Error('template required');
/**
* Initialize a new `View` with an optional `model`, `el` and `options`.
- 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 getAccounts
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.getAccounts = function (params, callback) {
function getUsers () {
fetch(`https://${process.env.AUTH0_DOMAIN}/api/v2/users?${qs.stringify(params)}`, {
headers: {
authorization: `Bearer ${managementAPIAccessToken}`,
Function populateGraphEdges
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Network.prototype.populateGraphEdges = function() {
var self = this;
// vertex associated with the last vertex point we passed in this sequence
var lastVertex = null;
Function exports
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (el) {
try {
// create the map
var map = L.map(el, {
attributionControl: {
Function showQuery
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showQuery (query) {
var plan = session.plan()
// If no querystring, see if we have them in the plan already
var from, to
Function exports
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (Model) {
Model
.attr('coordinate')
.attr('address')
.attr('original_address')
Function save
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
View.prototype.save = function (e) {
debug('save')
var data = serialize(this.el)
if (!data.internalId && !data.email) {
Function walkthrough
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function walkthrough () {
var intro = introJs()
intro.onbeforechange(function (el) {
if (el.classList.contains('option')) {
Function splitEdgeAtInternalPoints
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
NetworkGraph.prototype.splitEdgeAtInternalPoints = function(edge, points) {
var subEdgePoints = [],
newEdge, newEdgeInfoArr = [];
var fromVertex = edge.fromVertex;
each(edge.pointArray, function(point) {
Function formatDepartureTimes
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function formatDepartureTimes (times) {
var hours = {}
var maxPerHour = 0
var text = ''
Function refreshRenderData
has 41 lines of code (exceeds 25 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;
Function debug
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function debug(namespace) {
// define the `disabled` version
function disabled() {
}
Function createOrRetrieveAccount
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createOrRetrieveAccount (application, directory, data) {
return new Promise((resolve, reject) => {
directory.createAccount(data, {
registrationWorkflowEnabled: false
}, (err, account) => {
Function refresh
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Modal.prototype.refresh = function (e) {
if (e) e.preventDefault()
log('refreshing')
primaryFilter = this.primaryFilter.value
Function submit
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Modal.prototype.submit = function (e) {
e.preventDefault()
var alerts = this.find('.alerts')
var button = this.find('button')
var textarea = this.find('textarea')
Function initComparisons
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
NetworkGraph.prototype.initComparisons = function() {
this.bundleComparisons = {};
each(this.vertices, function(vertex) {
Function sendEmail
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
schema.methods.sendEmail = function (template, options) {
const name = `${this.givenName} ${this.surname}`
return new Promise((resolve, reject) => {
const opts = Object.assign({}, {
Function parse
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parse(str) {
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
if (!match) return;
var n = parseFloat(match[1]);
var type = (match[2] || 'ms').toLowerCase();