Showing 8 of 52 total issues
Function toGeometry
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
static toGeometry(csg: CSG, toMatrix: Matrix4): BufferGeometry {
let triCount = 0;
const ps = csg.polygons;
for (const p of ps) {
triCount += p.vertices.length - 2;
- 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 splitPolygon
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
splitPolygon(
polygon: Polygon,
coplanarFront: Polygon[],
coplanarBack: Polygon[],
front: Polygon[],
- 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 toGeometry
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
static toGeometry(csg: CSG, toMatrix: Matrix4): BufferGeometry {
let triCount = 0;
const ps = csg.polygons;
for (const p of ps) {
triCount += p.vertices.length - 2;
Function fromGeometry
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
static fromGeometry(geom: BufferGeometry, objectIndex?: any): CSG {
let polys = [];
const posattr = geom.attributes.position;
const normalattr = geom.attributes.normal;
const uvattr = geom.attributes.uv;
- 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 fromGeometry
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
static fromGeometry(geom: BufferGeometry, objectIndex?: any): CSG {
let polys = [];
const posattr = geom.attributes.position;
const normalattr = geom.attributes.normal;
const uvattr = geom.attributes.uv;
File CSG.ts
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
BufferAttribute,
BufferGeometry,
Material,
Matrix3,
Function splitPolygon
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
splitPolygon(
polygon: Polygon,
coplanarFront: Polygon[],
coplanarBack: Polygon[],
front: Polygon[],
Function build
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
build(polygons: Polygon[]): void {
if (!polygons.length) return;
if (!this.plane) this.plane = polygons[0].plane.clone();
const front = [],
back = [];
- 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"