ifosch/synthetic

View on GitHub

Showing 12 of 12 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

func tokenizeParams(input string) []string {
    // Solution taken from
    // https://groups.google.com/g/golang-nuts/c/pNwqLyfl2co/m/APaZSSvQUAAJ
    lastQuote := rune(0)
    // Must return true for symbols that delimit a field
Severity: Minor
Found in pkg/job_control/helpers.go and 1 other location - About 55 mins to fix
pkg/command/command.go on lines 32..56

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 125.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

func tokenizeCommand(input string) []string {
    // Solution taken from
    // https://groups.google.com/g/golang-nuts/c/pNwqLyfl2co/m/APaZSSvQUAAJ
    lastQuote := rune(0)
    // Must return true for symbols that delimit a field
Severity: Minor
Found in pkg/command/command.go and 1 other location - About 55 mins to fix
pkg/job_control/helpers.go on lines 8..32

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 125.

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

Further Reading

Lists should be surrounded by blank lines
Open

- A bot account on your team's workspace on Slack, with the token
Severity: Info
Found in README.md by markdownlint

MD032 - Lists should be surrounded by blank lines

Tags: bullet, ul, ol, blank_lines

Aliases: blanks-around-lists

This rule is triggered when lists (of any kind) are either not preceded or not followed by a blank line:

Some text
* Some
* List

1. Some
2. List
Some text

To fix this, ensure that all lists have a blank line both before and after (except where the block is at the beginning or end of the document):

Some text

* Some
* List

1. Some
2. List

Some text

Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse lists that don't have blank lines before and after them.

Note: List items without hanging indents are a violation of this rule; list items with hanging indents are okay:

* This is
not okay

* This is
  okay

2: cannot find package "github.com/ifosch/synthetic/pkg/command" in any of:
Open

    "github.com/ifosch/synthetic/pkg/command"
Severity: Minor
Found in cmd/main.go by govet

Lists should be surrounded by blank lines
Open

- Start providing some k8s management commands.
Severity: Info
Found in README.md by markdownlint

MD032 - Lists should be surrounded by blank lines

Tags: bullet, ul, ol, blank_lines

Aliases: blanks-around-lists

This rule is triggered when lists (of any kind) are either not preceded or not followed by a blank line:

Some text
* Some
* List

1. Some
2. List
Some text

To fix this, ensure that all lists have a blank line both before and after (except where the block is at the beginning or end of the document):

Some text

* Some
* List

1. Some
2. List

Some text

Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse lists that don't have blank lines before and after them.

Note: List items without hanging indents are a violation of this rule; list items with hanging indents are okay:

* This is
not okay

* This is
  okay

TODO found
Open

    _, err := js.jenkins.Init(context.TODO())
Severity: Minor
Found in pkg/job_control/jenkins_job_server.go by fixme

TODO found
Open

    number, err := j.client.BuildJob(context.TODO(), j.Name(), args)
Severity: Minor
Found in pkg/job_control/jenkins_job.go by fixme

TODO found
Open

    jobs, err := js.jenkins.GetAllJobs(context.TODO())
Severity: Minor
Found in pkg/job_control/jenkins_job_server.go by fixme

TODO found
Open

    build, err := j.client.GetBuild(context.TODO(), j.Name(), buildID)
Severity: Minor
Found in pkg/job_control/jenkins_job.go by fixme

TODO found
Open

        task.Poll(context.TODO())
Severity: Minor
Found in pkg/job_control/jenkins_job.go by fixme

TODO found
Open

        _, err = build.Poll(context.TODO())
Severity: Minor
Found in pkg/job_control/jenkins_job.go by fixme

TODO found
Open

    task, err := j.client.GetQueueItem(context.TODO(), number)
Severity: Minor
Found in pkg/job_control/jenkins_job.go by fixme
Severity
Category
Status
Source
Language