Function _repaintLabels
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
TimeAxis.prototype._repaintLabels = function () {
var orientation = this.options.orientation.axis;
// calculate range and step (step such that we have space for 7 characters per label)
var start = util.convert(this.body.range.start, 'Number');
- 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 TimeAxis.js
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
var util = require('../../util');
var Component = require('./Component');
var TimeStep = require('../TimeStep');
var DateUtil = require('../DateUtil');
var moment = require('../../module/moment');
Function _repaintLabels
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
TimeAxis.prototype._repaintLabels = function () {
var orientation = this.options.orientation.axis;
// calculate range and step (step such that we have space for 7 characters per label)
var start = util.convert(this.body.range.start, 'Number');
Function setOptions
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
TimeAxis.prototype.setOptions = function(options) {
if (options) {
// copy all options that we know
util.selectiveExtend([
'showMinorLabels',
- 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 redraw
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
TimeAxis.prototype.redraw = function () {
var props = this.props;
var foreground = this.dom.foreground;
var background = this.dom.background;
Function TimeAxis
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function TimeAxis (body, options) {
this.dom = {
foreground: null,
lines: [],
majorTexts: [],
Function setOptions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
TimeAxis.prototype.setOptions = function(options) {
if (options) {
// copy all options that we know
util.selectiveExtend([
'showMinorLabels',
Function redraw
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
TimeAxis.prototype.redraw = function () {
var props = this.props;
var foreground = this.dom.foreground;
var background = this.dom.background;
- 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
TODO found Open
props.minorLineWidth = 1; // TODO: really calculate width
- Exclude checks
TODO found Open
// TODO: recalculate sizes only needed when parent is resized or options is changed
- Exclude checks
TODO found Open
//label.title = title; // TODO: this is a heavy operation
- Exclude checks
TODO found Open
props.majorLineWidth = 1; // TODO: really calculate width
- Exclude checks
TODO found Open
//label.title = title; // TODO: this is a heavy operation
- Exclude checks
TODO found Open
// TODO: not so nice, this is applied globally to moment.js
- Exclude checks