Showing 34 of 64 total issues
Function setContext
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
setContext (ctx) {
super.setContext(ctx);
if (this.options.shadow.color) {
const shadowPosition = Position.from(this.options.shadow.position);
Function set
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
set (...colorDefinition) {
const [first] = colorDefinition;
let input;
let alpha;
if (first instanceof Color) {
Function setContext
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
setContext (ctx) {
if (this.options.clip) {
const clipping = new window.Path2D();
const { clip } = this.options;
const { x, y } = clip.position;
Function setContext
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
setContext (ctx) {
super.setContext(ctx);
if (this.options.shadow.color) {
const shadowPosition = Position.from(this.options.shadow.position);
- 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 url
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
set url (source) {
if (this.url === source) {
return;
}
- 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 trace
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
trace (path) {
const basePath = new window.Path2D();
this.base.trace(basePath);
const matrix = new window.DOMMatrix();
const { cos, sin } = Math;
- 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 getTarget
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getTarget (position, ctx) {
if (!this.options.shown) {
return 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 getOrigin
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getOrigin () {
const { origin } = this.options;
if (typeof origin === "string") {
const { origins } = Rectangle;
const position = new Position();
- 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 source
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
set source (newSource) {
if (newSource instanceof window.HTMLImageElement ||
newSource instanceof window.HTMLCanvasElement ||
newSource instanceof OffScreenCanvas) {
this[sourceKey] = newSource;
- 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 isHover
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
isHover (positionDefinition, ctx = OffScreenCanvas.getDrawingContext()) {
if (!this.options.shown) {
return false;
}
- 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 trace
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
trace (path) {
let lastPosition = new Position();
const instructions = this.instructions.slice();
if (Array.isArray(instructions)) {
- 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 get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
get (selector = "*") {
const filter = ((matcher) => {
if (typeof matcher === "function") {
return matcher;
}
- 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 set
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
set (...colorDefinition) {
const [first] = colorDefinition;
let input;
let alpha;
if (first instanceof Color) {
- 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 makePath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
makePath (ctx) {
if (this.willFill || this.willStroke) {
const origin = this.getOrigin();
ctx.translate(origin.x, origin.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"