Function _updateVertices
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
_updateVertices() {
// Algorithm:
// 1. Get plane parameters
// 2. Compute culling flags for all vertices
// 3. If intersection occurs => compute from 3 to 6 intersection points
- 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
File VolumeMesh.js
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
import VolumeMaterial from './shaders/VolumeMaterial'
import settings from '../settings'
import {
BufferAttribute,
BufferGeometry,
Function _updateVertices
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
_updateVertices() {
// Algorithm:
// 1. Get plane parameters
// 2. Compute culling flags for all vertices
// 3. If intersection occurs => compute from 3 to 6 intersection points
Function _updateIndices
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
_updateIndices() {
// Algorithm:
// 1. Get plane vertices (from 3 to 6 vertices)
// 2. Get "right" vector in plane
// 3. Sort vertices using Graham-like method
- 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 _updateIndices
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
_updateIndices() {
// Algorithm:
// 1. Get plane vertices (from 3 to 6 vertices)
// 2. Get "right" vector in plane
// 3. Sort vertices using Graham-like method
Function constructor
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor() {
const geo = new BufferGeometry()
super(geo)
this.clipPlane = new Plane()
const size = new Vector3(0.5, 0.5, 0.5)
Function _sortIndices
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_sortIndices(face, right) {
let i
let j
const vert = this.vertices
const angle = []
- 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
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return 0