Showing 135 of 207 total issues
System
has 62 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class System {
constructor(manifest, name, image, options = {}) {
this.manifest = manifest;
this.name = name;
File en-US.js
has 540 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// jscs:disable maximumLineLength
module.exports = {
terms_of_use: {
first_question: [
File index.js
has 530 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { _, t, path, fs, utils, isBlank, lazy_require } from 'azk';
import { version, config } from 'azk';
import { net } from 'azk/utils';
var lazy = lazy_require({
File vm.js
has 466 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { _, path, config, log, isBlank, fsAsync } from 'azk';
import { subscribe, publish } from 'azk/utils/postal';
import { async, promisify, thenAll, promisifyModule } from 'azk/utils/promises';
import Utils from 'azk/utils';
import { Tools } from 'azk/agent/tools';
Function subscribeTo
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
Open
subscribeTo(topic) {
if (topic) {
var subscribe_topic = topic;
var subscribe = azk_channel.subscribe.bind(azk_channel);
var log = require("azk/utils/log").log;
- 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
File configure.js
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { _, t, os, log, lazy_require, fsAsync } from 'azk';
import { publish } from 'azk/utils/postal';
import { async, promisify, thenAll, promiseResolve } from 'azk/utils/promises';
import { config, set_config } from 'azk';
import { UIProxy } from 'azk/cli/ui';
File run.js
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { _, t, lazy_require, isBlank } from 'azk';
import { config, log, path } from 'azk';
import { subscribe, publish } from 'azk/utils/postal';
import { defer, async, asyncUnsubscribe, promiseResolve, thenAll } from 'azk/utils/promises';
import { ImageNotAvailable, SystemRunError, RunCommandError, NotBeenImplementedError } from 'azk/utils/errors';
Function run
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function run(docker, Container, image, cmd, opts = { }) {
var container = null;
opts.stdout = opts.stdout || process.stdout;
opts.stderr = opts.stderr || opts.stdout;
Function _scale
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
Open
_scale(system, instances = {}, opts = undefined) {
var flags = {};
var _subscription = subscribe('#.status', (event) => {
if (!event) { return; }
var type;
- 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
File index.js
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { path, fs, config, _, t, log, lazy_require, isBlank } from 'azk';
import { System } from 'azk/system';
import { Validate } from 'azk/manifest/validate';
import { ManifestError, ManifestRequiredError, SystemNotFoundError } from 'azk/utils/errors';
import Utils from 'azk/utils';
UI
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
var UI = {
isUI: true,
t: t,
_interactive: true,
Function build
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function build(docker, options) {
return async(function* () {
var opts = _.extend({
cache: true
}, options);
Function constructor
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(opts) {
this.opts = _.merge({
namespace: config('configuration:namespace'),
}, opts);
Manifest
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class Manifest {
constructor(cwd, file = null, required = false) {
if (typeof file == "boolean") {
[required, file] = [file, null];
}
Function index
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
index() {
var { options } = this.normalized_params;
var args = this.normalized_params.arguments;
var _subscription = subscribe('docker.pull.status', (data) => {
Function _validate_wait_option
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static _validate_wait_option(manifest) {
return _.reduce(manifest.systems, (errors, system) => {
// ignore if it is not present or equal false
if (typeof system.options.wait === 'undefined' || system.options.wait === false) {
File balancer.js
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { _, t, path, fsAsync, config, log } from 'azk';
import { async, defer, promisifyAll, thenAll, promiseResolve } from 'azk/utils/promises';
import { lazy_require } from 'azk';
import { net } from 'azk/utils';
Function index
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
index() {
return async(this, function* () {
let args = this.normalized_params.arguments;
let options = this.normalized_params.options;
Function subscribeTo
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
subscribeTo(topic) {
if (topic) {
var subscribe_topic = topic;
var subscribe = azk_channel.subscribe.bind(azk_channel);
var log = require("azk/utils/log").log;
File get_project.js
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { path, lazy_require, config, log, fsAsync } from 'azk';
import { async, promiseResolve, promiseReject } from 'azk/utils/promises';
import { UIProxy } from 'azk/cli/ui';
import { matchFirstRegex, matchAllRegex, fulltrim } from 'azk/utils/regex_helper';
import { printOutput } from 'azk/utils/spawn_helper';