Showing 19 of 19 total issues

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

package cmd

import (
    "log"
    "os"
Severity: Major
Found in cmd/labels.go and 1 other location - About 3 hrs to fix
cmd/projects.go on lines 1..37

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

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

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

package cmd

import (
    "log"
    "os"
Severity: Major
Found in cmd/projects.go and 1 other location - About 3 hrs to fix
cmd/labels.go on lines 1..37

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

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

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

func (c *Client) GetProjects() ([]Project, error) {
    body, _, err := c.Get("projects")
    if err != nil {
        log.Printf("error getting projects: %s", err.Error())
        return nil, err
Severity: Minor
Found in client/projects.go and 1 other location - About 1 hr to fix
client/labels.go on lines 58..72

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

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

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

func (c *Client) GetLabels() ([]Label, error) {
    body, _, err := c.Get("labels")
    if err != nil {
        log.Printf("error getting labels: %s", err.Error())
        return nil, err
Severity: Minor
Found in client/labels.go and 1 other location - About 1 hr to fix
client/projects.go on lines 60..74

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

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

Similar blocks of code found in 3 locations. Consider refactoring.
Open

func PrintProjects(f *os.File, projects []Project, cols []string, sortCol string, dateFmt string) {
    w := CreateTable(f, cols)
    SortByField(projects, sortCol)

    // prepare a slice for cols and tabs
Severity: Major
Found in client/projects.go and 2 other locations - About 45 mins to fix
client/labels.go on lines 29..39
client/tasks.go on lines 35..46

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

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

Similar blocks of code found in 3 locations. Consider refactoring.
Open

func PrintLabels(f *os.File, labels []Label, cols []string, sortCol string, dateFmt string) {
    w := CreateTable(f, cols)
    SortByField(labels, sortCol)

    for _, l := range labels {
Severity: Major
Found in client/labels.go and 2 other locations - About 45 mins to fix
client/projects.go on lines 30..41
client/tasks.go on lines 35..46

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

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

Similar blocks of code found in 3 locations. Consider refactoring.
Open

func PrintTasks(f *os.File, tasks []Task, cols []string, sortCol string, dateFmt string) {
    w := CreateTable(f, cols)
    SortByField(tasks, sortCol)

    // prepare a slice for cols and tabs
Severity: Major
Found in client/tasks.go and 2 other locations - About 45 mins to fix
client/labels.go on lines 29..39
client/projects.go on lines 30..41

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

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

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

func (c *Client) FindLabel(name string) (Label, error) {
    labels, err := c.GetLabels()
    if err != nil {
        return Label{}, err
    }
Severity: Minor
Found in client/labels.go and 1 other location - About 40 mins to fix
client/projects.go on lines 44..57

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

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

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

func (c *Client) FindProject(name string) (Project, error) {
    projects, err := c.GetProjects()
    if err != nil {
        return Project{}, err
    }
Severity: Minor
Found in client/projects.go and 1 other location - About 40 mins to fix
client/labels.go on lines 42..55

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

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

Function PrintTasks has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

func PrintTasks(f *os.File, tasks []Task, cols []string, sortCol string, dateFmt string) {
Severity: Minor
Found in client/tasks.go - About 35 mins to fix

    Function PrintProjects has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func PrintProjects(f *os.File, projects []Project, cols []string, sortCol string, dateFmt string) {
    Severity: Minor
    Found in client/projects.go - About 35 mins to fix

      Function PrintLabels has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func PrintLabels(f *os.File, labels []Label, cols []string, sortCol string, dateFmt string) {
      Severity: Minor
      Found in client/labels.go - About 35 mins to fix

        Method Client.GetTasks has 5 return statements (exceeds 4 allowed).
        Open

        func (c *Client) GetTasks(project string, required []string, optional []string) ([]Task, error) {
            r := c.Request()
        
            if project != "" {
                r = r.SetQueryParam("project_id", project)
        Severity: Major
        Found in client/tasks.go - About 35 mins to fix

          2: cannot find package "github.com/go-resty/resty/v2" in any of:
          Open

              "github.com/go-resty/resty/v2"
          Severity: Minor
          Found in client/client.go by govet

          exported function FormatDate should have comment or be unexported
          Open

          func FormatDate(d DueDate, dateFmt string) (string, error) {
          Severity: Minor
          Found in client/client.go by golint

          exported method Client.Get should have comment or be unexported
          Open

          func (c *Client) Get(parts ...string) (body []byte, status int, err error) {
          Severity: Minor
          Found in client/client.go by golint

          exported type DueDate should have comment or be unexported
          Open

          type DueDate struct {
          Severity: Minor
          Found in client/tasks.go by golint

          exported method Client.BuildFilter should have comment or be unexported
          Open

          func (c *Client) BuildFilter(required []string, optional []string) string {
          Severity: Minor
          Found in client/tasks.go by golint

          exported function Execute should have comment or be unexported
          Open

          func Execute(client *client.Client) {
          Severity: Minor
          Found in cmd/root.go by golint
          Severity
          Category
          Status
          Source
          Language