Showing 241 of 478 total issues
Function timesQubitOperation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
timesQubitOperation(operation2x2, qubitIndex, controlMask, desiredValueMask) {
Util.need((controlMask & (1 << qubitIndex)) === 0, "Matrix.timesQubitOperation: self-controlled");
Util.need(operation2x2._width === 2 && operation2x2._height === 2, "Matrix.timesQubitOperation: not 2x2");
let {_width: w, _height: h, _buffer: old} = this;
- 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 interleavePainter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
let interleavePainter = reverse => args => {
if (args.positionInCircuit !== undefined) {
GatePainting.PERMUTATION_DRAWER(args);
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
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return equate_Indexables(subject, other);
Avoid too many return
statements within this function. Open
return equate_Sets(subject, other);
Avoid too many return
statements within this function. Open
return equate_Objects(subject, other);
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return value;
Avoid too many return
statements within this function. Open
return value.toString();
Avoid too many return
statements within this function. Open
return this._toString_bothValues(format);
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return value.toFixed(digits);
Function _paintGateTooltip_matrix
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static _paintGateTooltip_matrix(painter, gate, matrix, pad, dispSize, w, pushRect, nextY) {
if (matrix === undefined) {
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 _shiftAndSpliceColumn
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_shiftAndSpliceColumn(rowShift, gatesOfCol, insertCol, isInsert) {
// Move gates upward.
while (rowShift < 0 && gatesOfCol[0] === undefined) {
gatesOfCol.shift();
gatesOfCol.push(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 _updateMeasureMask_gateStep
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_updateMeasureMask_gateStep(state, row, disabledReasons) {
if (disabledReasons[row] !== undefined) {
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 previewDrop
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
previewDrop(hand) {
return hand.heldRow !== undefined ? this._previewDropMovedRow(hand) :
hand.heldColumn !== undefined ? this._previewDropMovedGateColumn(hand) :
hand.heldGate !== undefined ? this._previewDropMovedGate(hand) :
this._previewResizedGate(hand);
- 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 GATE_CIRCUIT_DRAWER
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
let GATE_CIRCUIT_DRAWER = args => {
let circuit = args.gate.knownCircuit;
if (circuit === undefined || args.gate.symbol !== '') {
if (args.gate.stableDuration() === Infinity) {
GatePainting.DEFAULT_DRAWER(args);
- 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 describe_Object
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function describe_Object(value, limit) {
let entries = [];
for (let k in value) {
if (!value.hasOwnProperty(k)) {
continue;
- 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 _findHeightWiseOverlapsInCol
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_findHeightWiseOverlapsInCol(col) {
let pushedGates = new Set();
let h = 0;
for (let row = 0; row < this.numWires; row++) {
h -= 1;
- 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"