Showing 207 of 207 total issues
Function waitService
has 62 lines of code (exceeds 25 allowed). Consider refactoring. 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
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
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
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
this.loggerSubscription = subscribe(subscribe_topic, function (data, envelope) {
try {
var final_string = '';
// timespan
Similar blocks of code found in 2 locations. Consider refactoring. Open
constructor(ui) {
super(ui);
this.type = "framework";
this.name = "php_cakephp";
this.rule_name = "php_cakephp";
- 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 82.
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
constructor(ui) {
super(ui);
this.type = "framework";
this.name = "php_laravel";
this.rule_name = "php_laravel";
- 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 82.
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
File court.js
has 264 lines of code (exceeds 250 allowed). Consider refactoring. 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
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
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
import { _, envs, mergeConfig } from 'azk/utils';
var path = require('path');
var os = require('os');
// Configs paths
Similar blocks of code found in 3 locations. Consider refactoring. Open
getFrameworkVersion(content) {
// http://regex101.com/r/qP4gG7/2
// version will be on the first group
var regex = /^\s*gem ['"]rails['"],\s+['"](.+?)['"]\s*$/gm;
var match = regex.exec(content);
- 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 80.
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 3 locations. Consider refactoring. Open
getVersion(content) {
// Ruby Version
// http://regex101.com/r/rO8iA0/3
var regex = /\s*\bruby ['"]?(\d+\.\d+\.\d+)['"]?/gm;
var match = regex.exec(content);
- 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 80.
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 3 locations. Consider refactoring. Open
getVersion(content) {
// Pyhton Version
// http://regex101.com/r/hH2uY1/1
var regex = /^python-(\d+\.\d+\.\d+)/gm;
var match = regex.exec(content);
- 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 80.
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
File net.js
has 260 lines of code (exceeds 250 allowed). Consider refactoring. 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
var Balancer = {
memcached : null,
hipache : null,
mem_client: null,
Configure
has 21 functions (exceeds 20 allowed). Consider refactoring. 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
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
vmStartProgress(cmd) {
return (event) => {
if (!event) {
return;
}
Function parseCommandOptions
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. 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"