src/utils/net.js
Function waitService
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
waitService(uri, opts = {}) {
opts = _.defaults(opts, {
timeout: 10000, // maximum timeout - this may be override
retry_if: () => { return promiseResolve(true); },
publish_retry: true,
File net.js
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { _, fs, lazy_require, config, set_config } from 'azk';
import { publish } from 'azk/utils/postal';
import { async, defer, ninvoke, promiseResolve } from 'azk/utils/promises';
import { envDefaultArray, isBlank } from 'azk/utils';
Function nameServers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
nameServers(custom_dns_servers, options={}) {
var dns_servers;
var nameservers = config(cache_key);
var env_dns_servers = envDefaultArray('AZK_DNS_SERVERS', []);
- 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 waitForwardingService
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
waitForwardingService(host, port, retry = 15, timeout = 10000) {
return defer((resolve, reject) => {
var client = null;
var attempts = 1, max = retry;
var connect = () => {
Function nameServers
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
nameServers(custom_dns_servers, options={}) {
var dns_servers;
var nameservers = config(cache_key);
var env_dns_servers = envDefaultArray('AZK_DNS_SERVERS', []);
Function waitService
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
waitService(uri, opts = {}) {
opts = _.defaults(opts, {
timeout: 10000, // maximum timeout - this may be override
retry_if: () => { return promiseResolve(true); },
publish_retry: true,
- 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"