Showing 6 of 9 total issues
Function applyConstraint
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
AngleConstraint.prototype.applyConstraint = function (index, p0, p1) {
/*jshint maxcomplexity:15*/
var ii = this.indices
var ai = ii[index], bi = ii[index + 1], ci = ii[index + 2]
Function _calculateNormal
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
PlaneConstraint.prototype._calculateNormal = function (index, p0) {
var b0 = this.bufferVec3
var ii = this.indices
var ai = ii[0], bi = ii[1], ci = ii[2]
Function applyConstraint
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
AngleConstraint.prototype.applyConstraint = function (index, p0, p1) {
/*jshint maxcomplexity:15*/
var ii = this.indices
var ai = ii[index], bi = ii[index + 1], ci = ii[index + 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 applyForce
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
PointForce.prototype.applyForce = function (ix, f0, p0, p1) {
var v0 = this.vector
var iy = ix + 1
var iz = ix + 2
Function ps_integrateParticle
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function ps_integrateParticle(i, p0, p1, f0, weight, d2) {
Function set
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Vec3.set = function (b0, i, x, y, z) {