File FrameInfo.js
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
import SecondaryStructureColorer from './colorers/SecondaryStructureColorer'
import { Vector3 } from 'three'
const cDataOffset = 12
const cFirstMask = 0x0fffff00
Function parseBinaryData
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseBinaryData(arrayBuffer) {
const dataView = new DataView(arrayBuffer)
let offset = 0
const atomsCount = dataView.getUint32(offset, true)
offset += 4
Function _prepareBuffer
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
_prepareBuffer(framesStart, framesEnd) {
if (framesStart === undefined || framesStart === null) {
framesStart = 0
}
if (framesEnd === undefined || framesEnd === null) {
- 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 _prepareBuffer
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
_prepareBuffer(framesStart, framesEnd) {
if (framesStart === undefined || framesStart === null) {
framesStart = 0
}
if (framesEnd === undefined || framesEnd === null) {
Function parseBinaryData
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
parseBinaryData(arrayBuffer) {
const dataView = new DataView(arrayBuffer)
let offset = 0
const atomsCount = dataView.getUint32(offset, true)
offset += 4
- 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 setFrame
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
setFrame(frameIdx) {
this.frameIsReady = false
if (
frameIdx >= this._framesRange.start &&
frameIdx <= this._framesRange.end
Function _createSecondary
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _createSecondary(strArray, complex) {
const residues = complex._residues
const nRes = residues.length
const resid = new Uint8Array(nRes)
Function _createSecondary
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function _createSecondary(strArray, complex) {
const residues = complex._residues
const nRes = residues.length
const resid = new Uint8Array(nRes)
- 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 setFrame
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
setFrame(frameIdx) {
this.frameIsReady = false
if (
frameIdx >= this._framesRange.start &&
frameIdx <= this._framesRange.end
- 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"