ltgcgo/octavia

View on GitHub
src/micc/utils.js

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 4 of 4 total issues

Function readUintBE has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

const readUintBE = (buffer, byteLength) => {
if (byteLength > 6) {
throw(new RangeError(`Cannot read more than 48 bits`));
};
if (byteLength > buffer.length) {
Severity: Minor
Found in src/micc/utils.js - About 55 mins to fix

Function buildVLV has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const buildVLV = (number) => {
if (!Number.isInteger(number)) {
throw(new TypeError(`Must be an integer`));
};5
if (number >= 268435456) {
Severity: Minor
Found in src/micc/utils.js - About 45 mins to fix

Function buildUintBE has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const buildUintBE = (number, byteLength) => {
if (byteLength > 6) {
throw(new RangeError(`Cannot write more than 48 bits`));
};
if (byteLength > buffer.length) {
Severity: Minor
Found in src/micc/utils.js - About 35 mins to fix

Function readVLV has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const readVLV = (buffer) => {
// Expects Uint8Array or the likes
let result = 0, ptr = 0, resume = true;
while (ptr < 4 && resume) {
if (ptr) {
Severity: Minor
Found in src/micc/utils.js - About 25 mins to fix

There are no issues that match your filters.

Category
Status