File EdgeBase.js
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
let util = require("../../../../../util");
let EndPoints = require("./EndPoints").default;
/**
Function getArrowData
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
getArrowData(ctx, position, viaNode, selected, hover, values) {
// set lets
let angle;
let arrowPoint;
let node1;
Function getArrowData
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
getArrowData(ctx, position, viaNode, selected, hover, values) {
// set lets
let angle;
let arrowPoint;
let node1;
- 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
EdgeBase
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class EdgeBase {
/**
* @param {Object} options
* @param {Object} body
* @param {Label} labelModule
Function _findBorderPositionCircle
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
_findBorderPositionCircle(node, ctx, options) {
let x = options.x;
let y = options.y;
let low = options.low;
let high = options.high;
- 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 _findBorderPositionCircle
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
_findBorderPositionCircle(node, ctx, options) {
let x = options.x;
let y = options.y;
let low = options.low;
let high = options.high;
Function getColor
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
getColor(ctx, values, selected, hover) { // eslint-disable-line no-unused-vars
if (values.inheritsColor !== false) {
// when this is a loop edge, just use the 'from' method
if ((values.inheritsColor === 'both') && (this.from.id !== this.to.id)) {
let grd = ctx.createLinearGradient(this.from.x, this.from.y, this.to.x, this.to.y);
- 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 _drawDashedLine
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drawDashedLine(ctx, values, viaNode, fromPoint, toPoint) { // eslint-disable-line no-unused-vars
ctx.lineCap = 'round';
let pattern = [5,5];
if (Array.isArray(values.dashes) === true) {
pattern = values.dashes;
Function getColor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
getColor(ctx, values, selected, hover) { // eslint-disable-line no-unused-vars
if (values.inheritsColor !== false) {
// when this is a loop edge, just use the 'from' method
if ((values.inheritsColor === 'both') && (this.from.id !== this.to.id)) {
let grd = ctx.createLinearGradient(this.from.x, this.from.y, this.to.x, this.to.y);
Function _drawDashedLine
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_drawDashedLine(ctx, values, viaNode, fromPoint, toPoint) { // eslint-disable-line no-unused-vars
ctx.lineCap = 'round';
let pattern = [5,5];
if (Array.isArray(values.dashes) === true) {
pattern = values.dashes;
- 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
* @param {{x: number, y: number}} [toPoint] TODO: Remove in next major release
- Exclude checks
TODO found Open
* @param {{x: number, y: number}} [fromPoint] TODO: Remove in next major release
- Exclude checks