Showing 135 of 207 total issues
Function _wait_available
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
_wait_available(system, port_data, container, timeout, options, image_conf) {
return async(this, function* () {
var host;
if (config('agent:requires_vm')) {
host = config('agent:vm:ip');
Function list
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
list(cli) {
let key_param = cli['config-key'];
let configList = this.configuration.listAll();
if (key_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 handler
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function handler(error, options = {}) {
return async(this, function* () {
let isError = error instanceof Error || error instanceof AzkError;
if (!isError) {
// no error type
Function constructor
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
constructor(opts) {
this.opts = _.merge({
namespace: config('configuration:namespace'),
}, opts);
- 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 sync
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
static sync(origin, destination, opts = {}) {
return stat(origin).then((stats) => {
let args = ['-az'];
let include = [], exclude = [];
let DIR_SEP = '';
Function startProject
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
startProject(command_parse_result) {
return async(this, function* () {
var force_azk_start_url_endpoint = config('urls:force:endpoints:start');
this._sendForceAzkStart(command_parse_result, force_azk_start_url_endpoint);
Function config_disks
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function config_disks(name, boot, data) {
var use_link = true;
var storage_opts = [
"storagectl" , name ,
Function init
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
init(opts = {}) {
opts = _.defaults(opts, {
dhcp: false,
});
Function _investigate
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_investigate(dir) {
return async(this, function* () {
var evidences = [],
filesToSearch = [],
relevantFiles = [],
Function _checkAzkVersion
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_checkAzkVersion() {
return async(this, function* () {
try {
// check connectivity
var currentOnline = yield net.isOnlineCheck();
Function _mounts_to_volumes
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mounts_to_volumes(mounts, daemon = true) {
var volumes = {};
// persistent folder
var persist_base = config('paths:persistent_folders');
Function scale
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
scale(system, instances = {}, options = {}) {
// Default instances
if (_.isObject(instances)) {
options = _.merge(instances, options);
instances = system.scalable.default;
Function runProvision
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
runProvision(system, options = {}) {
return async(this, function* () {
var steps = system.provision_steps;
options = _.clone(options);
Function _clean_sync_folder
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_clean_sync_folder(system, syncs) {
return async(this, function* () {
var local_user = config('agent:vm:user');
var uid, gid;
if (config('agent:requires_vm')) {
Function init
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
init() {
return defer((resolve, reject) => {
if (this._status === 'connecting' || this._status === 'connected') {
return resolve();
}
Function start
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
start(manifest, systems, opts) {
return async(this, function* () {
var result = yield this._scale(systems, 'start', opts);
// if flag --open
Function installVM
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
installVM(start = false) {
var vm_name = config("agent:vm:name");
return async(this, function* () {
var installed = yield VM.isInstalled(vm_name);
var running = (installed) ? yield VM.isRunnig(vm_name) : false;
Function _checkGitError
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
_checkGitError(git_repo, git_branch_tag_commit, git_destination_path) {
return function (err) {
var original_error = err.message;
var stack_trace = err.stack || '';
var error_type;
Function require
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Module.prototype.require = function(file, ...args) {
var result, require = () => {
return original.apply(this, [file, ...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 _findDockerfile
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
_findDockerfile(dockerfile_path) {
var msg;
if (this.system.hasOwnProperty('manifest') && this.system.manifest.cwd) {
var dockerfile_cwd = path.resolve(this.system.manifest.cwd, dockerfile_path);
- 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"