File SSIsosurfaceGeometry.js
has 721 lines of code (exceeds 250 allowed). Consider refactoring. Open
import IsoSurfaceGeometry from './IsoSurfaceGeometry'
import IsoSurfaceAtomColored from './IsoSurfaceAtomColored'
import IsosurfaceBuildNormals from './IsosurfaceBuildNormals'
import IsoSurfaceMarchCube from './IsoSurfaceMarchCube'
import IsoSurfaceGeo from './IsoSurfaceGeo'
Function _innerBuild
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
_innerBuild() {
let ok
const expandFactor = 1.2
// performance test
Function buildGeoFromCorners
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
buildGeoFromCorners(meshRes, vBoxMin, vBoxMax, corners, vCellStep, cube) {
const arrSize = 12
const cNumVerts = 8
const numCells = meshRes - 1
const side = meshRes
- 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 modifyExcludedFromGeo
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
modifyExcludedFromGeo(
side,
probeSphereRadius,
vBoxMin,
vBoxMax,
- 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 buildGeoFromCorners
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildGeoFromCorners(meshRes, vBoxMin, vBoxMax, corners, vCellStep, cube) {
const arrSize = 12
const cNumVerts = 8
const numCells = meshRes - 1
const side = meshRes
Function calculateGridCorners
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
calculateGridCorners(corners, side, vBoxMin, vBoxMax, atoms, probeRad) {
const side2 = side * side
const side3 = side2 * side
const vCorner = new Vector3()
const vDif = new Vector3()
- 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 getNumIntersectedCells
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
getNumIntersectedCells(side, numCells, corners, cube) {
const side2 = side * side
const cNumVerts = 8
let numIntersectedCells = 0
- 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 modifyExcludedFromGeo
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
modifyExcludedFromGeo(
side,
probeSphereRadius,
vBoxMin,
vBoxMax,
Function addVertexToGeo
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
addVertexToGeo(geoOut, vAdd) {
let entry
const oneHynberes = 0.01
const n815851 = 815851
const n37633 = 37633
Function calculateGridCorners
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
calculateGridCorners(corners, side, vBoxMin, vBoxMax, atoms, probeRad) {
const side2 = side * side
const side3 = side2 * side
const vCorner = new Vector3()
const vDif = new Vector3()
Function getBoundingBox
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
getBoundingBox(atoms, vBoxMin, vBoxMax) {
const bigNum = 10000000.0
vBoxMin.x = vBoxMin.y = vBoxMin.z = bigNum
vBoxMax.x = vBoxMax.y = vBoxMax.z = 0 - bigNum
- 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 getNumIntersectedCells
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
getNumIntersectedCells(side, numCells, corners, cube) {
const side2 = side * side
const cNumVerts = 8
let numIntersectedCells = 0
Function _fromGeo
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
_fromGeo(geoOut) {
let colors = null
const positions = utils.allocateTyped(
Float32Array,
(1 + 2) * geoOut._numVertices
Function getBoundingBox
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
getBoundingBox(atoms, vBoxMin, vBoxMax) {
const bigNum = 10000000.0
vBoxMin.x = vBoxMin.y = vBoxMin.z = bigNum
vBoxMax.x = vBoxMax.y = vBoxMax.z = 0 - bigNum
Function addVertexToGeo
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
addVertexToGeo(geoOut, vAdd) {
let entry
const oneHynberes = 0.01
const n815851 = 815851
const n37633 = 37633
- 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 deeply nested control flow statements. Open
if (i0 < 0) {
break
}
Avoid deeply nested control flow statements. Open
if (dist2 < probeSpRad2) {
distToSphere = Math.sqrt(dist2)
distToBorder = -(distToSphere - probeSphereRadius)
innerBlockWorkAround()
} // if (dist from corner point to sphere center more 2 radiuses)
Function _innerBuild
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_innerBuild() {
let ok
const expandFactor = 1.2
// performance test
- 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 deeply nested control flow statements. Open
if (cube.pointsValuesLinear[cubeValuesIndex + i] < 0.0) {
bitsInside |= 1 << i
}
Avoid deeply nested control flow statements. Open
if (!this.addTriangle(vaEdges[i0], vaEdges[i1], vaEdges[i2])) {
return 0 - 2
}
Avoid deeply nested control flow statements. Open
if (val < corners[ind]) {
corners[ind] = val
}
Consider simplifying this complex logical expression. Open
if (
a0 === null ||
a1 === null ||
a2 === null ||
a0.srcAtom === null ||
Function _fromGeo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_fromGeo(geoOut) {
let colors = null
const positions = utils.allocateTyped(
Float32Array,
(1 + 2) * geoOut._numVertices
- 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
Similar blocks of code found in 3 locations. Consider refactoring. Open
const ix = Math.floor(
(hashResolution * (vAdd.x - this.vBoxMin.x)) /
(this.vBoxMax.x + oneHynberes - this.vBoxMin.x)
)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 63.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
const iy = Math.floor(
(hashResolution * (vAdd.y - this.vBoxMin.y)) /
(this.vBoxMax.y + oneHynberes - this.vBoxMin.y)
)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 63.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
const iz = Math.floor(
(hashResolution * (vAdd.z - this.vBoxMin.z)) /
(this.vBoxMax.z + oneHynberes - this.vBoxMin.z)
)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 63.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
const dot2 = v.x * v.x + v.y * v.y + v.z * v.z
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 45.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
vDif.x * vDif.x + vDif.y * vDif.y + vDif.z * vDif.z
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 45.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76