Showing 711 of 1,553 total issues
Function change
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
change(repSettings, complex, mode, color) {
const diff = {}
// modify selector
if (repSettings.selector) {
- 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 12 (exceeds 5 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')
- 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 _finalize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
_finalize(serialAtomMap, residueHash, complex) {
if (this.init instanceof Residue && this.term instanceof Residue) {
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 _updateSecStructure
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
_updateSecStructure(complex, residue, groupData) {
const helixClasses = [3, -1, 1, -1, 5]
if (!isUndefined(groupData) && groupData.secStruct === this._ssType) {
residue._secondary = this._ssStruct
- 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 _updateInfoPanel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
_updateInfoPanel() {
const info = this._msgAtomInfo.getElementsByTagName('p')[0]
let atom
let residue
- 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 _getAltObj
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
_getAltObj() {
if (this._editors) {
let altObj = null
for (let i = 0; i < this._editors.length; ++i) {
const nextAltObj = this._editors[i].getAltObj()
- 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 _fillSourceList
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Menu.prototype._fillSourceList = function () {
const self = this
const names = this._viewer.getVisuals()
$('#miew-source-dropdown').toggle(names.length > 1)
Function constructor
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(params) {
super()
// add fog
this.fog = true
// used for instanced geometry
Function constructor
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
BondsGroup,
geoParams,
complex,
colorer,
Function _writeRelations
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_writeRelations() {
let modelsList = ''
for (let i = 0; i < this._info.models.length; ++i) {
modelsList += `
Model: "Model::${this._info.name}_${i}", "Mesh" {
Function _continueAnimation
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_continueAnimation() {
this._isAnimating = true
let minFrameTime = 1000 / settings.now.maxfps
minFrameTime = Number.isNaN(minFrameTime) ? 0 : minFrameTime
const self = this
Function checkArg
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function checkArg(key, arg, modificate) {
if (key !== undefined && arg !== undefined) {
if (keyRemap(key) === 'selector') {
var res = selectors.parse(arg);
if (res.error !== undefined) {
Function checkArg
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function checkArg(key, arg, modificate) {
if (key !== undefined && arg !== undefined) {
if (keyRemap(key) === 'selector') {
var res = selectors.parse(arg);
if (res.error !== undefined) {
Function constructor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
AtomsGroup,
geoParams,
complex,
colorer,
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 _countNormalsInRing
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_countNormalsInRing(ptsCount, vtxIdx, isSlope, shiftToExtraPt) {
const tmpShape = this._tmpShape
const normals = this._normals
tmpShape[0].fromArray(this._positions, vtxIdx)
Function update
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
ObjectHandler.prototype.update = (function () {
const axis = new Vector3()
return function (timeSinceLastUpdate, timeSinceMove) {
if (settings.now.autoRotation !== 0.0) {
Function _build
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_build() {
const self = this
for (let i = 0; i < this._complex._residues.length - 1; ++i) {
const ri = this._complex._residues[i]
Function _fixDir
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_fixDir(refPoint, currDir, posGetter) {
// count atoms to the right and to the left of the current plane
let rightCount = 0
let leftCount = 0
const tmpVec = refPoint.clone()
Function _flattenModels
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_flattenModels() {
let overallVertsCount = 0
function shift(x) {
return x + overallVertsCount
}