Showing 207 of 207 total issues
Function daemonOptions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
daemonOptions(options = {}, image_conf = {}) {
// Merge ports
options.ports = _.merge({}, this.ports, options.ports);
options.ports_order = _.map(options.ports, (port, name) => {
return !_.isEmpty(port) && name;
Function index
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
index() {
return async(this, function* () {
yield Helpers.requireAgent(this.ui);
// Get deploy [commands] avaible
Similar blocks of code found in 2 locations. Consider refactoring. Open
export class ImageNotAvailable extends AzkError {
constructor(system, image) {
super('image_not_available');
this.system = system;
this.image = image;
- 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
export class SystemNotFoundError extends AzkError {
constructor(manifest, system) {
super('system_not_found');
this.manifest = manifest;
- 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 escapeCapture
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
escapeCapture(callback) {
// Escape sequence
var escapeBuffer = false;
var escape = false;
Function _checkDockerVersion
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
_checkDockerVersion(force = null) {
var versions = {
required: config('docker:min_version'),
current : force || config('docker:version'),
};
Function nameServers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
nameServers(custom_dns_servers, options={}) {
var dns_servers;
var nameservers = config(cache_key);
var env_dns_servers = envDefaultArray('AZK_DNS_SERVERS', []);
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
gulp.task('replace-font-path-en', function(){
return gulp.src(['./content/_book/en/gitbook/print.css',
'./content/_book/en/gitbook/style.css',])
.pipe(replace(/\.\/\/fonts/g, './fonts'))
.pipe(gulp.dest('./content/_book/en/gitbook/'));
- 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 60.
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
gulp.task('replace-font-path-pt-BR', function(){
return gulp.src(['./content/_book/pt-BR/gitbook/print.css',
'./content/_book/pt-BR/gitbook/style.css',])
.pipe(replace(/\.\/\/fonts/g, './fonts'))
.pipe(gulp.dest('./content/_book/pt-BR/gitbook/'));
- 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 60.
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 add_logo
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
add_logo(data) {
let final = (`
##########
##################
######################
Function runShell
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
runShell(system, options = {}) {
return async(this, function* () {
options = _.defaults(options, {
remove: false,
sequencies: yield this._getSequencies(system)
Function expandExportEnvs
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
expandExportEnvs(data) {
var ports, envs = {};
// Defaults options
data = _.defaults(data, { envs: {}, net: {}, });
Function _have_dollar_sign_string_interpotation
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
static _have_dollar_sign_string_interpotation(manifest) {
// https://regex101.com/r/eZ4mQ6/3
var dollar_check = /((?:[$]{|<%|#{-|#{=)[=|-]?)(.*\..*)(}|%>)/;
return _.reduce(manifest.systems, (errors, system) => {
var raw = system.options.raw;
Function waitForwardingService
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
waitForwardingService(host, port, retry = 15, timeout = 10000) {
return defer((resolve, reject) => {
var client = null;
var attempts = 1, max = retry;
var connect = () => {
Function watch
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
watch(origin, destination, opts = {}) {
this.unwatch();
this.status = WATCH_INIT;
return async(this, function* () {
Function stop
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
stop(system, instances, options = {}) {
options = _.defaults(options, {
kill: false,
remove: true,
});
Function runDaemon
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
runDaemon(system, options = {}) {
return async(this, function* () {
// TODO: add instances and dependencies options
// Prepare options
var image = yield this._check_image(system, options);
Function constructor
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(...args) {
super(...args);
var name = 'ruby';
// Readable name for this suggestion
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (!_.isNumber(system.options.wait) && !_.isObject(system.options.wait)) {
return errors.concat(
this._entry('fail', 'invalid_option_type', manifest, {
option: 'wait',
value: system.options.wait,
- 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 59.
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 (_.isNumber(system.options.wait) && system.options.wait <= 0) {
return errors.concat(
this._entry('fail', 'invalid_option_value', manifest, {
option: 'wait',
value: system.options.wait,
- 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 59.
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