Showing 92 of 92 total issues
Method Platform.Prune
has 6 return statements (exceeds 4 allowed). Open
func (p *Platform) Prune(region, stage string, versions int) error {
p.events.Emit("prune", nil)
if err := p.createRole(); err != nil {
return errors.Wrap(err, "creating iam role")
Function status
has 6 return statements (exceeds 4 allowed). Open
func status(cmd *kingpin.Cmd) {
c := cmd.Command("status", "Status of your account.").Default()
c.Action(func(_ *kingpin.ParseContext) error {
var config userconfig.Config
Function unsubscribe
has 6 return statements (exceeds 4 allowed). Open
func unsubscribe(cmd *kingpin.Cmd) {
c := cmd.Command("unsubscribe", "Unsubscribe from the Pro plan.")
c.Action(func(_ *kingpin.ParseContext) error {
config, err := userconfig.Require()
Method Platform.Deploy
has 6 return statements (exceeds 4 allowed). Open
func (p *Platform) Deploy(d up.Deploy) error {
regions := p.config.Regions
var g errgroup.Group
if err := p.createRole(); err != nil {
Function New
has 6 return statements (exceeds 4 allowed). Open
func New(c *up.Config, h http.Handler) (http.Handler, error) {
h = poweredby.New("up", h)
h = robots.New(c, h)
h = static.NewDynamic(c, h)
Function Build
has 6 return statements (exceeds 4 allowed). Open
func Build(dir string) (io.ReadCloser, *archive.Stats, error) {
upignore, err := read(".upignore")
if err != nil {
return nil, nil, errors.Wrap(err, "reading .upignore")
}
Method Stack.Create
has 6 return statements (exceeds 4 allowed). Open
func (s *Stack) Create(versions resources.Versions) error {
c := s.config
tmpl := s.template(versions)
name := c.Name
Method Stack.showNameservers
has 6 return statements (exceeds 4 allowed). Open
func (s *Stack) showNameservers(stage *config.Stage) error {
if stage.Domain == "" {
return nil
}
Method Platform.Build
has 6 return statements (exceeds 4 allowed). Open
func (p *Platform) Build() error {
start := time.Now()
p.zip = new(bytes.Buffer)
if err := p.injectProxy(); err != nil {
Method Platform.DeleteStack
has 6 return statements (exceeds 4 allowed). Open
func (p *Platform) DeleteStack(region string, wait bool) error {
versions := resources.Versions{}
for _, s := range p.config.Stages {
versions[s.Name] = "1"
Function New
has 6 return statements (exceeds 4 allowed). Open
func New(c *up.Config, next http.Handler) (http.Handler, error) {
if len(c.Redirects) == 0 {
return next, nil
}
Similar blocks of code found in 2 locations. Consider refactoring. Open
func (r *response) Write(b []byte) (int, error) {
if r.ignore {
return len(b), nil
}
- 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 108.
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 (r *rewrite) Write(b []byte) (int, error) {
if r.isNotFound {
return len(b), nil
}
- 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 108.
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 Platform.createFunction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func (p *Platform) createFunction(c *lambda.Lambda, a *apigateway.APIGateway, up *s3manager.Uploader, region string, d up.Deploy) (version string, err error) {
Method Platform.updateFunction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func (p *Platform) updateFunction(c *lambda.Lambda, a *apigateway.APIGateway, up *s3manager.Uploader, region string, d up.Deploy) (version string, err error) {
Similar blocks of code found in 4 locations. Consider refactoring. Open
func (c *Client) AddInvite(token, email string) error {
in := struct {
Email string `json:"email"`
}{
Email: email,
- 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 106.
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 4 locations. Consider refactoring. Open
func (c *Client) AddCard(token, cardToken string) error {
in := struct {
Token string `json:"token"`
}{
Token: cardToken,
- 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 106.
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 4 locations. Consider refactoring. Open
func (c *Client) RemoveMember(token, email string) error {
in := struct {
Email string `json:"email"`
}{
Email: email,
- 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 106.
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 4 locations. Consider refactoring. Open
func (c *Client) AddFeedback(token, message string) error {
in := struct {
Message string `json:"message"`
}{
Message: message,
- 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 106.
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 Stack.report
has 5 return statements (exceeds 4 allowed). Open
func (s *Stack) report(states map[string]Status) error {
defer s.events.Time("platform.stack.report", event.Fields{
"total": len(states),
"complete": 0,
})()