Showing 207 of 207 total issues
Function callAgent
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
callAgent(opts) {
var params = {
action: _.head(this.route.actions) || opts.action
};
// Create a progress output
Similar blocks of code found in 2 locations. Consider refactoring. Open
constructor(ui) {
super(ui);
this.type = 'framework';
this.name = 'elixir_phoenix';
this.rule_name = 'elixir_phoenix';
- 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 75.
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 = "ruby_on_rails";
this.rule_name = "ruby_on_rails";
- 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 75.
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 parseCommandOptions
has 49 lines of code (exceeds 25 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'];
Function _wait_available
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
_wait_available(system, port_data, container, timeout, options, image_conf) {
return async(this, function* () {
var host;
if (config('agent:requires_vm')) {
host = config('agent:vm:ip');
Function list
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
list(cli) {
let key_param = cli['config-key'];
let configList = this.configuration.listAll();
if (key_param) {
- 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 handler
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function handler(error, options = {}) {
return async(this, function* () {
let isError = error instanceof Error || error instanceof AzkError;
if (!isError) {
// no error type
Function constructor
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
constructor(opts) {
this.opts = _.merge({
namespace: config('configuration:namespace'),
}, opts);
- 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 sync
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
static sync(origin, destination, opts = {}) {
return stat(origin).then((stats) => {
let args = ['-az'];
let include = [], exclude = [];
let DIR_SEP = '';
Function startProject
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
startProject(command_parse_result) {
return async(this, function* () {
var force_azk_start_url_endpoint = config('urls:force:endpoints:start');
this._sendForceAzkStart(command_parse_result, force_azk_start_url_endpoint);
Function config_disks
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function config_disks(name, boot, data) {
var use_link = true;
var storage_opts = [
"storagectl" , name ,
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (instances.length > 0) {
name = cli.ui.c.green(`${system.name}`);
status = cli.ui.c.green(`↑`);
} else if (!system.auto_start) {
name = cli.ui.c.yellow(`${system.name}`);
- 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 68.
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
} else if (!system.auto_start) {
name = cli.ui.c.yellow(`${system.name}`);
status = cli.ui.c.yellow(`−`);
} else {
name = cli.ui.c.red(`${system.name}`);
- 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 68.
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 init
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
init(opts = {}) {
opts = _.defaults(opts, {
dhcp: false,
});
Function _investigate
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_investigate(dir) {
return async(this, function* () {
var evidences = [],
filesToSearch = [],
relevantFiles = [],
Function _checkAzkVersion
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_checkAzkVersion() {
return async(this, function* () {
try {
// check connectivity
var currentOnline = yield net.isOnlineCheck();
Function _mounts_to_volumes
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mounts_to_volumes(mounts, daemon = true) {
var volumes = {};
// persistent folder
var persist_base = config('paths:persistent_folders');
Similar blocks of code found in 2 locations. Consider refactoring. Open
constructor(ui) {
super(ui);
this.type = "database";
this.name = "mysql";
this.rule_name = "mysql";
- 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
constructor(ui) {
super(ui);
this.type = "database";
this.name = "postgres";
this.rule_name = "postgres";
- 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 scale
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
scale(system, instances = {}, options = {}) {
// Default instances
if (_.isObject(instances)) {
options = _.merge(instances, options);
instances = system.scalable.default;