Showing 135 of 207 total issues
Function constructor
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
constructor(extra_values, tracker, configuration = null) {
extra_values = _.merge({}, {
meta: {},
server: {},
}, extra_values);
- 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 _subscription
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var _subscription = subscribe('#.status', (event) => {
if (!event) { return; }
var type;
if (event.type === "pull_msg") {
this.view('image_pull').render(event);
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(msg) {
if (msg.type !== "pull_msg") {
return msg;
}
Function _veredict
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_veredict() {
_.forEach(this.__folder_evidences_suggestion, function(folder_evidence_suggestion) {
var systemName = '';
var folderName = folder_evidence_suggestion.path;
var evidences_suggestion = folder_evidence_suggestion.suggestions;
Function _system_validate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 });
Function _scale
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_scale(systems, action, opts) {
var args = this.normalized_params.arguments;
var args_systems = (args.system || '').split(',');
args_systems = _.map(args_systems, (s) => (s || '').trim());
Function systemsInOrder
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
systemsInOrder(requireds = []) {
var edges = [];
_.each(this.systems, (system, name) => {
if (_.isEmpty(system.depends)) {
edges.push(["__", name]);
Function suggestion
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
get suggestion() {
let name = this.name;
let upper_name = name.toUpperCase();
let suggestion = _.extend({}, example_system, {
__type : 'postgres',
Function throwRunError
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
throwRunError(system, container, command, data = null, stop = false, options = {}) {
data = data ? promiseResolve(data) : container.inspect();
return data.then((data) => {
// Get container log
var promise = container.logs({stdout: true, stderr: true}).then((stream) => {
Function mount
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mount(vm_name, share, point, opts = {}) {
_.defaults(opts, {
umask: "0000",
gid : "vboxsf",
uid : config("agent:vm:user"),
Function daemonOptions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function index
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
index() {
return async(this, function* () {
yield Helpers.requireAgent(this.ui);
// Get deploy [commands] avaible
Function escapeCapture
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
escapeCapture(callback) {
// Escape sequence
var escapeBuffer = false;
var escape = false;
Function _checkDockerVersion
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_checkDockerVersion(force = null) {
var versions = {
required: config('docker:min_version'),
current : force || config('docker:version'),
};
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 add_logo
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add_logo(data) {
let final = (`
##########
##################
######################
Function runShell
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
runShell(system, options = {}) {
return async(this, function* () {
options = _.defaults(options, {
remove: false,
sequencies: yield this._getSequencies(system)
Function expandExportEnvs
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
expandExportEnvs(data) {
var ports, envs = {};
// Defaults options
data = _.defaults(data, { envs: {}, net: {}, });
Function _have_dollar_sign_string_interpotation
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static _have_dollar_sign_string_interpotation(manifest) {
// https://regex101.com/r/eZ4mQ6/3
var dollar_check = /((?:[$]{|<%|#{-|#{=)[=|-]?)(.*\..*)(}|%>)/;
return _.reduce(manifest.systems, (errors, system) => {
var raw = system.options.raw;
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 = () => {