Showing 348 of 348 total issues
Function SetupRunner
has 191 lines of code (exceeds 50 allowed). Consider refactoring. Open
func SetupRunner(
cfg *config.Config,
appOptions *options.AppOptions,
runOptions *options.RunOptions,
) (runner *Runner, err error) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
package config
import (
"encoding/json"
"fmt"
- 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 299.
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
package config
import (
"encoding/json"
"fmt"
- 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 299.
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 run_task.go
has 570 lines of code (exceeds 500 allowed). Consider refactoring. Open
package runner
import (
"context"
"fmt"
Similar blocks of code found in 2 locations. Consider refactoring. Open
package jsonconfig
import (
"encoding/json"
- 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 242.
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
package jsonconfig
import (
"encoding/json"
- 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 242.
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
Method Runner.Run
has 75 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (r *Runner) Run(plans []string) bool {
r.logger.Info(
nil,
"Beginning run %s",
r.runID,
Method StageRunner.buildTaskRunnerFunc
has 69 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (r *StageRunner) buildTaskRunnerFunc(
stageTask *config.StageTask,
index int,
task config.Task,
context *RunContext,
Method PlanRunner.Run
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (r *PlanRunner) Run(
context *RunContext,
name string,
prefix *logging.Prefix,
) bool {
Method Config.Translate
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (c *Config) Translate(parent *config.Config) (*config.Config, error) {
extends, err := util.UnmarshalStringList(c.Extends)
if err != nil {
return nil, err
}
Function LoadFile
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
func LoadFile(path string, override *config.Override) (*config.Config, error) {
overridePaths, err := getOverridePaths()
if err != nil {
return nil, fmt.Errorf(
"failed to determine override paths: %s",
Function NewRunner
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
ctx context.Context,
logger logging.Logger,
config *config.Config,
taskRunnerFactory TaskRunnerFactory,
scratch *scratch.ScratchSpace,
Function SetupRunner
has 11 return statements (exceeds 4 allowed). Open
func SetupRunner(
cfg *config.Config,
appOptions *options.AppOptions,
runOptions *options.RunOptions,
) (runner *Runner, err error) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
func (t *Transferer) Import(patterns, blacklistPatterns []string) error {
blacklist, err := constructBlacklist(t.project, blacklistPatterns)
if err != nil {
return err
}
- 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 131.
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
func (t *Transferer) Export(patterns, blacklistPatterns []string) error {
blacklist, err := constructBlacklist(t.workspace, blacklistPatterns)
if err != nil {
return err
}
- 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 131.
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 NewRunTaskRunnerFactory
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
ctx context.Context,
cfg *config.Config,
runID string,
scratch *scratch.ScratchSpace,
containerLists *ContainerLists,
Function NewStageRunner
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
ctx context.Context,
logger logging.Logger,
config *config.Config,
taskRunnerFactory TaskRunnerFactory,
plan *config.Plan,
Method Config.Translate
has 10 return statements (exceeds 4 allowed). Open
func (c *Config) Translate(parent *config.Config) (*config.Config, error) {
extends, err := util.UnmarshalStringList(c.Extends)
if err != nil {
return nil, err
}
Function LoadFile
has 9 return statements (exceeds 4 allowed). Open
func LoadFile(path string, override *config.Override) (*config.Config, error) {
overridePaths, err := getOverridePaths()
if err != nil {
return nil, fmt.Errorf(
"failed to determine override paths: %s",
Function runTaskCommandBuilderFactory
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
runID string,
config *config.Config,
containerOptions *containerOptions,
scratch *scratch.ScratchSpace,
task *config.RunTask,