Showing 160 of 160 total issues
Function status
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function status(api) {
const servers = Object.values(api.getConfig().servers || {});
const lines = [];
let overallColor = 'green';
const command = 'lsb_release -r -s || echo "false"; lsb_release -is; apt-get -v &> /dev/null && echo "true" || echo "false"; echo $BASH';
Function setup
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function setup(api) {
log('exec => mup meteor setup');
const config = api.getConfig().app;
if (!config) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (exposedPorts.length > 0) {
const exposedSection = statusDisplay.addLine('Exposed Ports:');
exposedPorts.forEach(port => {
exposedSection.addLine(`- ${port}`);
});
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 67.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (publishedPorts.length > 0) {
const publishedSection = statusDisplay.addLine('Published Ports (Inside Container => On Server):');
publishedPorts.forEach(port => {
publishedSection.addLine(`- ${port}`);
});
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 67.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function ssh
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ssh(api) {
const servers = api.getConfig().servers;
let serverOption = api.getArgs()[1];
// Check how many sessions are enabled. Usually is all servers,
Function init
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function init(api) {
const configSource = api.resolvePath(__dirname, 'template/mup.js.sample');
const settingsSource = api.resolvePath(__dirname, 'template/settings.json');
const { appPath, dest, createFolder } = findDestination(api);
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (typeof options.hostVars === 'object' && options.hostVars[session._host]) {
options.vars = merge(options.vars, options.hostVars[session._host]);
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 65.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (typeof options.hostVars === 'object' && options.hostVars[session._host]) {
options.vars = merge(options.vars, options.hostVars[session._host]);
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 65.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function status
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function status(api) {
const config = api.getConfig();
const {
StatusDisplay
} = api.statusHelpers;
Function setup
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function setup(api) {
log('exec => mup mongo setup');
const mongoConfig = api.getConfig().mongo;
if (!mongoConfig) {
Function findDestination
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function findDestination(api) {
const base = process.cwd();
const inMeteorApp = fs.existsSync(api.resolvePath(base, '.meteor/release'));
const parentMeteorApp = fs.existsSync(api.resolvePath(base, '../.meteor/release'));
Function buildApp
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function buildApp(appPath, buildOptions, verbose, api) {
// Check if the folder exists
try {
fs.statSync(api.resolvePath(appPath));
} catch (e) {
Function destroy
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function destroy(api) {
const config = api.getConfig();
const options = api.getOptions();
if (!options.force) {
Function push
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function push(api) {
log('exec => mup meteor push');
await api.runCommand('meteor.build');
const {
Function runSSHCommand
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function runSSHCommand(info, command) {
if (info instanceof nodemiral.session) {
return runSessionCommand(info, command);
}
Similar blocks of code found in 2 locations. Consider refactoring. Open
it('should support shorter override format', () => {
function target() {}
commands['plugin.docker-setup'] = target;
registerCommandOverrides('plugin', {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 61.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
it('should add override to list of commands', () => {
function target() {}
commands['plugin.docker-setup'] = target;
registerCommandOverrides('plugin', {
'docker.setup': 'plugin.docker-setup'
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 61.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function runSessionCommand
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function runSessionCommand(session, command) {
return new Promise((resolve, reject) => {
let client;
let done;
Function doCall
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function doCall() {
tries += 1;
try {
const result = await axios({
method,
Function findClusters
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function findClusters(serverInfo) {
const usedNodeIds = [];
const clusters = currentManagers(serverInfo).reduce((result, manager) => {
const {
swarm,