File Core.js
has 801 lines of code (exceeds 250 allowed). Consider refactoring. Open
var Emitter = require('emitter-component');
var Hammer = require('../module/hammer');
var hammerUtil = require('../hammerUtil');
var util = require('../util');
var TimeAxis = require('./component/TimeAxis');
Function setOptions
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
Core.prototype.setOptions = function (options) {
if (options) {
// copy the known options
var fields = [
'width', 'height', 'minHeight', 'maxHeight', 'autoResize',
- 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 _create
has 224 lines of code (exceeds 25 allowed). Consider refactoring. Open
Core.prototype._create = function (container) {
this.dom = {};
this.dom.container = container;
Function _create
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
Core.prototype._create = function (container) {
this.dom = {};
this.dom.container = container;
- 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 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
Core.prototype._redraw = function() {
this.redrawCount++;
var resized = false;
var options = this.options;
var props = this.props;
Function setOptions
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Core.prototype.setOptions = function (options) {
if (options) {
// copy the known options
var fields = [
'width', 'height', 'minHeight', 'maxHeight', 'autoResize',
Function _redraw
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Core.prototype._redraw = function() {
this.redrawCount++;
var resized = false;
var options = this.options;
var props = this.props;
- 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 onMouseWheel
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onMouseWheel(event) {
if (this.isActive()) {
this.emit('mousewheel', event);
}
Function _setDOM
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Core.prototype._setDOM = function () {
var props = this.props;
var dom = this.dom;
props.leftContainer.width = props.left.width;
Function setWindow
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Core.prototype.setWindow = function(start, end, options, callback) {
if (typeof arguments[2] == "function") {
callback = arguments[2];
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 _startAutoResize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Core.prototype._startAutoResize = function () {
var me = this;
this._stopAutoResize();
- 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 _updateScrollTop
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Core.prototype._updateScrollTop = function () {
// recalculate the scrollTopMin
var scrollTopMin = Math.min(this.props.centerContainer.height - this.props.center.height, 0); // is negative or zero
if (scrollTopMin != this.props.scrollTopMin) {
// in case of bottom orientation, change the scrollTop such that the contents
- 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
// TODO: move this function to Range
- Exclude checks
TODO found Open
// TODO: only calculate autoHeight when needed (else we cause an extra reflow/repaint of the DOM)
- Exclude checks
TODO found Open
// TODO: move this function to Range
- Exclude checks
TODO found Open
// TODO: deprecated since version 1.1.0, remove some day
- Exclude checks
TODO found Open
// TODO: cleanup
- Exclude checks
TODO found Open
// TODO: move this function to Range
- Exclude checks
TODO found Open
// TODO: compensate borders when any of the panels is empty.
- Exclude checks
TODO found Open
// TODO: move this function to Range
- Exclude checks