Showing 711 of 1,553 total issues
Function updateToFrame
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
updateToFrame(frameData) {
// This method looks like a copy paste. However, it
// was decided to postpone animation refactoring until GFX is fixed.
const bondsIdc = this._selection.chunks
const { bonds } = this._selection
- 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 _findPairs
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
_findPairs() {
const vw = this._complex.getVoxelWorld()
if (vw === null) {
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 toURL
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function toURL(opts) {
const stringList = []
let idx = 0
function checkAndAdd(prefix, value) {
- 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 writeString
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
writeString(string, begin, end) {
let curStr = this._resultArray[this._currentStr]
let str
const curStrLength = curStr ? curStr.length : 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 updateBinaryMode
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function updateBinaryMode(opts) {
let { binary } = opts
// detect by format
if (opts.fileType !== undefined) {
- 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 _extractAtoms
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
_extractAtoms(complex, complexData) {
const atomData = complexData.atom_site
if (!atomData) {
throw new AtomDataError('CIF parsing error: atom_site is not specified!')
}
- 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 _buildInner
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
_buildInner(radOffset, addChunk) {
const chunksToIdx = this._selection.chunks
const prevVector = new Vector3()
const currVector = new Vector3()
Function _parseAtoms
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
_parseAtoms(atomsNum, MOL2Data) {
this._toHeaderString('ATOM', MOL2Data)
for (let i = 0; i < atomsNum; i++) {
const parsedStr = splitToFields(MOL2Data[++this._currPosIdx])
Function buildColors
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildColors(numVertices, vertices, colors, radiusColorSmoothness) {
const self = this
let vx = 0.0
let vy = 0.0
let vz = 0.0
Function equalOptions
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function equalOptions(original, generated) {
function compareAllExceptReps(one, another) {
const origKeys = Object.keys(one)
let i
Function _finalize
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
_finalize() {
const self = this
;[this._firstAtom] = this._atoms
this._lastAtom = this._atoms[this._atoms.length - 1]
Function pickObject
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Picker.prototype.pickObject = function (screenPos) {
if (!this.gfxObj) {
this.picked = {}
this.dispatchEvent({ type: 'newpick', obj: {} })
return
Function _forEachAtomWithinDistFromGroup
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
_forEachAtomWithinDistFromGroup(forEachAtom, dist, process) {
const self = this
const r2 = dist * dist
const voxels = []
Function anonymous
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
performAction: function anonymous(
yytext,
yyleng,
yylineno,
yy,
Function _extractAtoms
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
_extractAtoms(complex, complexData) {
let aids = complexData.atoms && complexData.atoms.aid
let elements = aids && complexData.atoms.element
if (!elements || aids.length !== elements.length) {
throw new Error('Unable to parse atom elements')
Function _onPick
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onPick(event) {
if (!settings.now.picking) {
// picking is disabled
return
}
Function getState
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
getState(opts) {
const state = {}
opts = defaults(opts, {
compact: true,
Function checkArg
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
checkArg(key, arg, modificate) {
if (key !== undefined && arg !== undefined) {
if (keyRemap(key) === 'selector') {
const res = selectors.parse(arg)
- 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 deriveDeep
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function deriveDeep(obj, needZeroOwnProperties) {
var res = obj;
var i;
var n;
if (obj instanceof Array) {
- 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 deriveDeep
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function deriveDeep(obj, needZeroOwnProperties) {
var res = obj;
var i;
var n;
if (obj instanceof Array) {
- 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"