Showing 41 of 41 total issues

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

package command

import (
    "github.com/eure/bobo/engine"
)
Severity: Major
Found in command/task_reaction_emoji_engine.go and 1 other location - About 1 hr to fix
command/task_reply_thread_engine.go on lines 1..30

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

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 command

import (
    "github.com/eure/bobo/engine"
)
Severity: Major
Found in command/task_reply_thread_engine.go and 1 other location - About 1 hr to fix
command/task_reaction_emoji_engine.go on lines 1..30

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

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

type name will be used as command.CommandSet by other packages, and that stutters; consider calling this Set
Open

type CommandSet struct {
Severity: Minor
Found in command/command__set.go by golint

type name will be used as slack.SlackEngine by other packages, and that stutters; consider calling this Engine
Open

type SlackEngine struct {
Severity: Minor
Found in engine/slack/slack_engine.go by golint

exported method CommandData.HasMyMention should have comment or be unexported
Open

func (d CommandData) HasMyMention() bool {
Severity: Minor
Found in command/command__data.go by golint

comment on exported type Task should be of the form "Task ..." (with optional leading article)
Open

// Single task interface.
Severity: Minor
Found in command/task.go by golint

exported method Config.GetCommandSet should have comment or be unexported
Open

func (c Config) GetCommandSet() *command.CommandSet {
Severity: Minor
Found in config.go by golint

exported type Config should have comment or be unexported
Open

type Config interface{}
Severity: Minor
Found in engine/engine.go by golint

exported type Fetcher should have comment or be unexported
Open

type Fetcher interface {
Severity: Minor
Found in run_option.go by golint

2: cannot find package "github.com/eure/bobo/engine" in any of:
Open

    "github.com/eure/bobo/engine"
Severity: Minor
Found in bot.go by govet

exported func NewReplyEngineTask returns unexported type *command.replyEngineTask, which can be annoying to use
Open

func NewReplyEngineTask(e engine.Engine, channel, text string) *replyEngineTask {
Severity: Minor
Found in command/task_reply_engine.go by golint

exported method Config.GetLogger should have comment or be unexported
Open

func (c Config) GetLogger() log.Logger {
Severity: Minor
Found in config.go by golint

exported method CommandData.GetRegexpList should have comment or be unexported
Open

func (d CommandData) GetRegexpList() []CommandTemplate {
Severity: Minor
Found in command/command__data.go by golint

exported function NewCommandSet should have comment or be unexported
Open

func NewCommandSet(templateList ...CommandTemplate) *CommandSet {
Severity: Minor
Found in command/command__set.go by golint

exported method BasicCommandTemplate.GetHelp should have comment or be unexported
Open

func (c BasicCommandTemplate) GetHelp() string {
Severity: Minor
Found in command/command__template.go by golint

exported type SlackLogger should have comment or be unexported
Open

type SlackLogger struct {
Severity: Minor
Found in engine/slack/slack_logger.go by golint

exported method CommandData.GetMentionMap should have comment or be unexported
Open

func (d CommandData) GetMentionMap() map[string]CommandTemplate {
Severity: Minor
Found in command/command__data.go by golint

exported method BasicCommandTemplate.HasHelp should have comment or be unexported
Open

func (c BasicCommandTemplate) HasHelp() bool {
Severity: Minor
Found in command/command__template.go by golint

exported func NewReplyThreadEngineTask returns unexported type *command.replyThreadEngineTask, which can be annoying to use
Open

func NewReplyThreadEngineTask(e engine.Engine, channel, text, timestamp string) *replyThreadEngineTask {
Severity: Minor
Found in command/task_reply_thread_engine.go by golint

exported type MultiFetcher should have comment or be unexported
Open

type MultiFetcher struct {
Severity: Minor
Found in run_option_fetcher.go by golint
Severity
Category
Status
Source
Language