Showing 135 of 207 total issues
Function remove
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
remove(vm_name) {
return Tools.async_status("vm", this, function* (status_change) {
var info = yield vm.info(vm_name);
if (info.name == vm_name) {
Function _checkAndSaveIp
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_checkAndSaveIp(nameserver, file, use_vm, services_ports) {
return async(this, function* () {
// Not exist or invalid content
var dns_port = _.isObject(nameserver) ? nameserver.port : null;
var unmatched_dns_port = dns_port !== services_ports.dns;
Function set
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
set(cmd) {
let key_param = cmd['config-key'];
let value_param = cmd['config-value'];
if (key_param && value_param) {
- 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 _system_validate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_system_validate(name, properties) {
var msg, opts;
// system_name must not contain anything not valid in docker container name
if (!name.match(/^[a-zA-Z0-9-]+$/)) {
msg = t("manifest.system_name_invalid", { system: name });
- 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 _addOrRemove
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_addOrRemove(system, container, method) {
return async(this, function* () {
if (system.balanceable) {
var data = yield container.inspect();
if (data.State.Running) {
- 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 mount
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function mount(data) {
if (_.isString(data)) { return json(data); }
var options = _.reduce(data, (opts, value, key) => {
if (key != 'value' && key != 'type') {
opts[key] = value;
- 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 getEvidence
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getEvidence(path, content) {
var framework;
if (this.type === 'framework') {
framework = this.getFrameworkVersion(content);
- 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 daemonOptions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
daemonOptions(options = {}, image_conf = {}) {
// Merge ports
options.ports = _.merge({}, this.ports, options.ports);
options.ports_order = _.map(options.ports, (port, name) => {
return !_.isEmpty(port) && name;
- 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 _parse_provider
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_parse_provider(options) {
var provider = null;
var hasProvider = options.hasOwnProperty('provider');
if (hasProvider) {
- 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 _status
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_status(label, second, ...args) {
var message;
if (second instanceof Error) {
if (second instanceof AzkError) {
- 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 constructor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
constructor(cwd, file = null, required = false) {
if (typeof file == "boolean") {
[required, file] = [file, 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 _include_and_except
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_include_and_except(origin, src, dest, opts) {
let include = opts.include;
let except = opts.except;
if (origin !== src) {
- 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 _wait_available
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
_wait_available(system, port_data, container, timeout, options, image_conf) {
Function throwRunError
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
throwRunError(system, container, command, data = null, stop = false, options = {}) {
Function run
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function run(docker, Container, image, cmd, opts = { }) {
Function clone
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
clone(git_url, git_branch_tag_commit, dest_folder, is_new_git, scanFunction) {
Function _parse_option
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_parse_option(option, regex, split, fail, key_index = 0, format = null) {
var result = {};
for (var j = 0; j < option.length; j++) {
var opt = option[j];
if (opt.match(regex)) {
- 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 _getNetworkIp
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_getNetworkIp(suggestion) {
var question = {
name : 'ip',
message : 'configure.ip_question',
// default : config('agent:vm:ip'),
- 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 _daemon_command
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_daemon_command(options, image_conf) {
var command = options.command || this.command;
var empty_img_cmd = _.isEmpty(image_conf.Cmd);
var empty_img_entry = _.isEmpty(image_conf.Entrypoint);
var empty_cmd = _.isEmpty(command);
- 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 processStateHandler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
processStateHandler() {
var gracefullExit = (signal) => {
if (!this.stopping) {
var catch_err = (err) => log.error('[agent] stop error' + err.stack || err);
try {
- 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"