Showing 301 of 580 total issues
Function sortVertices
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
NetworkGraph.prototype.sortVertices = function() {
this.vertices.sort(function(a, b) {
if (a.point && a.point.getType() === 'PLACE') return -1;
if (b.point && b.point.getType() === 'PLACE') return 1;
- 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 tally
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
ProfileScore.prototype.tally = function (o) {
// Defaults
o.bikeCalories = 0
o.calories = 0
o.cost = 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 getXHR
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
request.getXHR = function () {
if (root.XMLHttpRequest
&& ('file:' != root.location.protocol || !root.ActiveXObject)) {
return new XMLHttpRequest;
} else {
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(reactive){
/**
* Generate attribute bindings.
*/
- 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 debug
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function debug(namespace) {
// define the `disabled` version
function disabled() {
}
- 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 getModeStyles
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Styler.prototype.getModeStyles = function(mode, display) {
var modeStyles = {};
// simulate a segment w/ the specified style
var segment = {
Function updateRange
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
View.prototype.updateRange = function () {
var view = this
var fromDate = moment(this.fromDatePicker.getDate())
var toDate = moment(this.toDatePicker.getDate())
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.render = function() {
base.render.call(this);
var self = this;
var display = this.transitive.display;
Function initMarkerData
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.initMarkerData = function(display) {
if (this.getType() !== 'STOP' && this.getType() !== 'MULTI') return;
this.mergedMarkerData = this.constructMergedMarker(display);
Function sendEmail
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
ShareModal.prototype.sendEmail = function () {
var self = this
var fromName = this.find('.from-name').value
if (!fromName || fromName === '') {
Function iterateAndApply
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
schema.statics.iterateAndApply = function (fn, opts) {
const tick = opts.tick || function () {}
const limit = opts.limit || 100
return new Promise((resolve, reject) => {
let more = true
Function toggleManager
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Row.prototype.toggleManager = function () {
var org = this.model
var manager = org.manager
alerts.clear()
if (this.isAdmin()) {
Function Renderer
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Renderer = augment(Object, function() {
this.constructor = function(transitive) {
this.transitive = transitive;
};
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
RenderedSegment.prototype.render = function(display) {
this.line = d3.svg.line() // the line translation function
.x(function(data, i) {
return data.x;
Function WireframeRenderer
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var WireframeRenderer = augment(Renderer, function(base) {
this.constructor = function(transitive) {
base.constructor.call(this, transitive);
};
Function journey
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Profiler.prototype.journey = function(opts, callback) {
var batch = new Batch();
var profiler = this;
// If a profile isn't passed, retrieve the profile
Function next
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function next() {
var i = index++;
var fn = fns[i];
if (!fn) return;
var start = new Date;
Function enabled
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function enabled() {
var self = enabled;
// set `diff` timestamp
Function bounds
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
NetworkGraph.prototype.bounds = function() {
var xmax = null,
xmin = null;
var ymax = null,
ymin = null;
- 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 refresh
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Modal.prototype.refresh = function (e) {
if (e) e.preventDefault()
log('refreshing')
primaryFilter = this.primaryFilter.value
- 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"