Showing 711 of 1,553 total issues
Function _initGfx
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initGfx() {
const gfx = {
width: this._container.clientWidth,
height: this._container.clientHeight
}
Function setColorVolTex
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
setColorVolTex(colorMap, atomMap, atomWeightMap, visibilitySelector) {
let i
let idx
const numVerts = this._position.length / 3
const vertices = this._position
File MiewCLIHelp.js
has 427 lines of code (exceeds 250 allowed). Consider refactoring. Open
// import palettes from '../gfx/palettes' // TODO actualy, does nothing
// import settings from '../settings'
const modeIdDesc = {
$help: [
Function _innerBuild
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
_innerBuild() {
let ok
const expandFactor = 1.2
// performance test
File ContactSurface.js
has 421 lines of code (exceeds 250 allowed). Consider refactoring. Open
import utils from '../../utils'
import { Vector3 } from 'three'
/**
* Modifed from SpatialHash
File CIFParser.js
has 421 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Parser from './Parser'
import chem from '../../chem'
import StructuralElement from '../../chem/StructuralElement'
import readCIF from './readCIF'
import { isArray, isString } from 'lodash'
Function _buildSelectorFromSortedLists
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
_buildSelectorFromSortedLists(atoms, residues, chains) {
const complex = this._complex
function optimizeList(list) {
const result = []
- 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 ObjectControls
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ObjectControls(object, objectPivot, camera, domElement, getAltObj) {
EventDispatcher.call(this)
const self = this
this.object = object
File settings.js
has 417 lines of code (exceeds 250 allowed). Consider refactoring. Open
import utils from './utils'
import EventDispatcher from './utils/EventDispatcher'
import { isEmpty, isString, get, set, merge, cloneDeep, filter } from 'lodash'
const VERSION = 0
Function _initReprListItemListeners
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
Menu.prototype._initReprListItemListeners = function (index) {
const self = this
const reprList = $(
`${self._menuId} [data-panel-type=miew-menu-panel-representation] .miew-repr-list`
)
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 _initOnSettingsChanged
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initOnSettingsChanged() {
const on = (props, func) => {
props = isArray(props) ? props : [props]
props.forEach((prop) => {
this.settings.addEventListener(`change:${prop}`, func)
Function setColorVolTex
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
setColorVolTex(colorMap, atomMap, atomWeightMap, visibilitySelector) {
let i
let idx
const numVerts = this._position.length / 3
const vertices = this._position
- 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 options.js
has 406 lines of code (exceeds 250 allowed). Consider refactoring. Open
import settings from './settings'
import utils from './utils'
import logger from './utils/logger'
import { isString, set, get, isArray, isEmpty } from 'lodash'
Function _updateReprList
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
Menu.prototype._updateReprList = function () {
const self = this
function _createOptionsFromMVData(index, property, element, itemId) {
const curRep = self._viewer.repGet(index)
Function createVoxels
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
createVoxels() {
let numAtomsRefs
let rad
const ATOM_VOXEL_REF_SCALE = 4.5
- 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 Smooth.js
has 398 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
Smooth.js version 0.1.7
Turn arrays into smooth functions.
File MMTFParser.js
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Parser from './Parser'
import chem from '../../chem'
import MMTF from '../../vendors/mmtf'
import StructuralElement from '../../chem/StructuralElement'
import { isArrayBuffer, isUndefined } from 'lodash'
File gfxutils.js
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable no-magic-numbers */
import logger from '../utils/logger'
import CSS2DObject from './CSS2DObject'
import RCGroup from './RCGroup'
Function parse
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse: function parse(input) {
var self = this,
stack = [0],
tstack = [],
vstack = [null],