Showing 78 of 160 total issues
File command-handlers.js
has 534 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
addStartAppTask,
checkAppStarted,
createEnv,
createServiceConfig,
File plugin-api.js
has 446 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as swarmUtils from './swarm-utils';
import * as tasks from './tasks';
import * as utils from './utils';
import configValidator, { showDepreciations, showErrors } from './validate/index';
import { hooks, runRemoteHooks } from './hooks';
Function setup
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function setup(api) {
log('exec => mup proxy setup');
const config = api.getConfig().proxy;
const serverConfig = api.getConfig().servers;
const appConfig = api.getConfig().app;
File command-handlers.js
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { addProxyEnv, getLoadBalancingHosts, getSessions } from './utils';
import chalk from 'chalk';
import { clone } from 'lodash';
import debug from 'debug';
import fs from 'fs';
Function envconfig
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function envconfig(api) {
log('exec => mup meteor envconfig');
const {
servers,
app,
PluginAPI
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class PluginAPI {
constructor(base, filteredArgs, program) {
this.base = program.config ? path.dirname(program.config) : base;
this.args = filteredArgs;
this._origionalConfig = null;
Function prepareBundleLocally
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function prepareBundleLocally(
buildLocation, bundlePath, api
) {
const {
app: appConfig,
Function setupSwarm
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function setupSwarm(api) {
const config = api.getConfig();
if (!api.swarmEnabled()) {
return;
Function debugApp
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function debugApp(api) {
const {
servers,
app
} = api.getConfig();
Function _loadSessions
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
_loadSessions() {
const config = this.getConfig();
this.sessions = {};
- 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 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function status(api) {
const config = api.getConfig();
const lines = [];
let overallColor = 'green';
File utils.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Client } from 'ssh2-classic';
import debug from 'debug';
import expandTilde from 'expand-tilde';
import fs from 'fs';
import net from 'net';
Function getInformation
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function getInformation(server, appName, api) {
return api.runSSHCommand(server, `sudo docker inspect ${appName} --format "{{json .}}"`)
// eslint-disable-next-line complexity
.then(({ host, output }) => {
let info;
Function reconfigShared
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function reconfigShared(api) {
const config = api.getConfig().proxy;
const shared = config.shared || {};
if (!config) {
Function status
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function status(api) {
const config = api.getConfig();
const swarmEnabled = api.swarmEnabled();
if (!config.servers) {
Function status
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function status(api) {
const config = api.getConfig();
if (!config.mongo) {
return;
File command-handlers.js
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { checkVersion, shouldShowDockerWarning } from './utils';
import {
curry,
difference,
intersection
Function scrubConfig
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
export function scrubConfig(config, { scrubUrl }) {
if (!config.proxy) {
return config;
}
- 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 prepareBundle
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function prepareBundle(api) {
log('exec => mup meteor prepare-bundle');
const {
app: appConfig,
privateDockerRegistry
Function _loadSessions
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_loadSessions() {
const config = this.getConfig();
this.sessions = {};