Showing 135 of 207 total issues
Function _scale
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_scale(system, instances = {}, opts = undefined) {
var flags = {};
var _subscription = subscribe('#.status', (event) => {
if (!event) { return; }
var type;
Function _make_options
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_make_options(daemon, options = {}, image_conf = {}) {
// Default values
options = _.defaults(options, {
workdir: this.options.workdir,
mounts: {},
Function __convertFoldersToSystems
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
__convertFoldersToSystems() {
let systems = {};
let not_version = [];
_.forEach(this.__folder_evidences_suggestion, function(folder_evidence_suggestion) {
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,
Function watch
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
watch(origin, destination, opts) {
var id = this.calculate_id(origin, destination);
let promise = defer((resolve, reject) => {
log.info('[sync] Adding watcher, from: %s, to: %s, opts: %j', origin, destination, opts, {});
Function status
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static status(cli, manifest, systems, opts = {}) {
return async(cli, function* () {
// Force types if not interactive or narrow console
if (cli.ui.outputColumns() === -1) {
opts.text = true;
Function list
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
list(cli) {
let key_param = cli['config-key'];
let configList = this.configuration.listAll();
if (key_param) {
Function loggerSubscription
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.loggerSubscription = subscribe(subscribe_topic, function (data, envelope) {
try {
var final_string = '';
// timespan
File court.js
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { _, log, fsAsync } from 'azk';
import { async, mapPromises } from 'azk/utils/promises';
import { UIProxy } from 'azk/cli/ui';
import { SugestionChooser } from 'azk/generator/sugestion_chooser';
Function promise
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
let promise = defer((resolve, reject) => {
log.info('[sync] Adding watcher, from: %s, to: %s, opts: %j', origin, destination, opts, {});
if (this.workers[id]) {
this.workers[id].count++;
this.publish('init', { status: 'exists' });
File errors.js
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { _, t, os } from 'azk';
var BASE_CODE_ERROR = 1;
var MANIFEST_CODE_ERROR = 2;
var SYSTEMS_CODE_ERROR = 3;
File config.js
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { _, envs, mergeConfig } from 'azk/utils';
var path = require('path');
var os = require('os');
// Configs paths
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';
Balancer
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
var Balancer = {
memcached : null,
hipache : null,
mem_client: null,
Configure
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class Configure extends UIProxy {
constructor(user_interface) {
super(user_interface);
this.dns_tab = ports_tabs[os.platform()];
this.docker_ip = null;
Utils
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
var Utils = {
get default () { return Utils; },
get _ () { return _; },
get net () { return require('azk/utils/net'); },
get docker () { return require('azk/utils/docker'); },
Function vmStartProgress
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vmStartProgress(cmd) {
return (event) => {
if (!event) {
return;
}
Function parseCommandOptions
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
static parseCommandOptions(opts) {
var is_start = opts.start;
var system_name = opts.system;
var git_repo = opts['git-repo'];
var git_ref = opts['git-ref'];
- 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 callAgent
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
callAgent(opts) {
var params = {
action: _.head(this.route.actions) || opts.action
};
// Create a progress output
Function parseCommandOptions
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static parseCommandOptions(opts) {
var is_start = opts.start;
var system_name = opts.system;
var git_repo = opts['git-repo'];
var git_ref = opts['git-ref'];