src/elements/element.arc.ts
File element.arc.ts
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import Element from '../core/core.element.js';
import {_angleBetween, getAngleFromPoint, TAU, HALF_PI, valueOrDefault} from '../helpers/index.js';
import {PI, _isBetween, _limitValue} from '../helpers/helpers.math.js';
import {_readValueToProps} from '../helpers/helpers.options.js';
import type {ArcOptions, Point} from '../types/index.js';
Function pathArc
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function pathArc(
ctx: CanvasRenderingContext2D,
element: ArcElement,
offset: number,
spacing: number,
Function pathArc
has a Cognitive Complexity of 18 (exceeds 7 allowed). Consider refactoring. Open
Open
function pathArc(
ctx: CanvasRenderingContext2D,
element: ArcElement,
offset: number,
spacing: 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
Function drawBorder
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawBorder(
ctx: CanvasRenderingContext2D,
element: ArcElement,
offset: number,
spacing: number,
Function drawBorder
has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring. Open
Open
function drawBorder(
ctx: CanvasRenderingContext2D,
element: ArcElement,
offset: number,
spacing: 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
Function pathArc
has 6 arguments (exceeds 5 allowed). Consider refactoring. Open
Open
ctx: CanvasRenderingContext2D,
element: ArcElement,
offset: number,
spacing: number,
end: number,