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"
)
- 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 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
- 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 command
import (
"github.com/eure/bobo/engine"
)
- 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 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
- 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
type name will be used as command.CommandSet by other packages, and that stutters; consider calling this Set Open
type CommandSet struct {
- Exclude checks
type name will be used as slack.SlackEngine by other packages, and that stutters; consider calling this Engine Open
type SlackEngine struct {
- Exclude checks
exported method CommandData.HasMyMention should have comment or be unexported Open
func (d CommandData) HasMyMention() bool {
- Exclude checks
comment on exported type Task should be of the form "Task ..." (with optional leading article) Open
// Single task interface.
- Exclude checks
exported method Config.GetCommandSet should have comment or be unexported Open
func (c Config) GetCommandSet() *command.CommandSet {
- Exclude checks
exported type Config should have comment or be unexported Open
type Config interface{}
- Exclude checks
exported type Fetcher should have comment or be unexported Open
type Fetcher interface {
- Exclude checks
2: cannot find package "github.com/eure/bobo/engine" in any of: Open
"github.com/eure/bobo/engine"
- Exclude checks
exported func NewReplyEngineTask returns unexported type *command.replyEngineTask, which can be annoying to use Open
func NewReplyEngineTask(e engine.Engine, channel, text string) *replyEngineTask {
- Exclude checks
exported method Config.GetLogger should have comment or be unexported Open
func (c Config) GetLogger() log.Logger {
- Exclude checks
exported method CommandData.GetRegexpList should have comment or be unexported Open
func (d CommandData) GetRegexpList() []CommandTemplate {
- Exclude checks
exported function NewCommandSet should have comment or be unexported Open
func NewCommandSet(templateList ...CommandTemplate) *CommandSet {
- Exclude checks
exported method BasicCommandTemplate.GetHelp should have comment or be unexported Open
func (c BasicCommandTemplate) GetHelp() string {
- Exclude checks
exported type SlackLogger should have comment or be unexported Open
type SlackLogger struct {
- Exclude checks
exported method CommandData.GetMentionMap should have comment or be unexported Open
func (d CommandData) GetMentionMap() map[string]CommandTemplate {
- Exclude checks
exported method BasicCommandTemplate.HasHelp should have comment or be unexported Open
func (c BasicCommandTemplate) HasHelp() bool {
- Exclude checks
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 {
- Exclude checks
exported type MultiFetcher should have comment or be unexported Open
type MultiFetcher struct {
- Exclude checks