Showing 6 of 6 total issues
Function decode_response
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
decode_response (data) {
function decode_string (data2, start, end) {
let str = '';
for (let a=start; a<end; a++) {
Function connect
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
connect (path) {
this.sock = net.createConnection(path);
this.sock.setTimeout(5 * 1000);
this.sock.on('connect', () => {
Function decode_response
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
decode_response (data) {
function decode_string (data2, start, end) {
let str = '';
for (let a=start; a<end; a++) {
- 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 process_send_queue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
process_send_queue () {
if (this.send_queue.length === 0) { return; }
for (let i=0; i<this.send_queue.length; i++) {
let item;
- 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 query
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
query (ip, cb) {
if (this.socket_has_error) {
return cb(this.socket_has_error);
}
if (!this.connected) {
- 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 format_results
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function format_results (r) {
const data = [];
if (r.os_name) data.push(`os="${r.os_name} ${r.os_flavor}"`);
if (r.link_type) data.push(`link_type="${r.link_type}"`);
if (r.distance) data.push(`distance=${r.distance}`);
- 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"