evalphobia/bobo-experiment

View on GitHub

Showing 79 of 79 total issues

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

func (s SQSCommand) runSQS(d command.CommandData) command.Command {
    c := command.Command{}

    sqsCli, err := getOrCreateSQSClient()
    if err != nil {
Severity: Major
Found in experiment/aws/example_command_sqs.go and 1 other location - About 6 hrs to fix
experiment/aws/example_command_dynamodb.go on lines 47..94

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

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 (s DynamoDBCommand) run(d command.CommandData) command.Command {
    c := command.Command{}

    ddbCli, err := getOrCreateDynamoDBClient()
    if err != nil {
Severity: Major
Found in experiment/aws/example_command_dynamodb.go and 1 other location - About 6 hrs to fix
experiment/aws/example_command_sqs.go on lines 47..94

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

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 (s SQSCommand) createGraph(stats sqsStats) (string, error) {
    dp, err := stats.FetchDetail(s.Metrics...)
    if err != nil {
        return "", fmt.Errorf("[ERROR]\t[FetchDetail]\t`%s`", err.Error())
    }
Severity: Major
Found in experiment/aws/example_command_sqs.go and 1 other location - About 1 hr to fix
experiment/aws/example_command_dynamodb.go on lines 96..111

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

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 (s DynamoDBCommand) createGraph(stats ddbStats) (string, error) {
    dp, err := stats.FetchDetail(s.Metrics...)
    if err != nil {
        return "", fmt.Errorf("[ERROR]\t[FetchDetail]\t`%s`", err.Error())
    }
Severity: Major
Found in experiment/aws/example_command_dynamodb.go and 1 other location - About 1 hr to fix
experiment/aws/example_command_sqs.go on lines 96..111

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

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 main has 58 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func main() {
    bobo.Run(bobo.RunOption{
        Engine: &slack.SlackEngine{},
        Logger: &log.StdLogger{
            IsDebug: bobo.IsDebug(),
Severity: Minor
Found in cmd/main.go - About 1 hr to fix

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

    func (s *SQSPurgeCommand) init() {
        s.listOnce.Do(func() {
            s.whitelist = make(map[string]struct{})
            for _, v := range s.Whitelist {
                s.whitelist[v] = struct{}{}
    Severity: Major
    Found in experiment/aws/example_command_sqs_purge.go and 2 other locations - About 1 hr to fix
    experiment/faceplusplus/example_command_merge.go on lines 55..66
    experiment/faceplusplus/example_command_merge_target.go on lines 56..67

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

    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 (m *MergeCommand) init() {
        m.listOnce.Do(func() {
            m.whitelist = make(map[string]struct{})
            for _, s := range m.Whitelist {
                m.whitelist[s] = struct{}{}
    Severity: Major
    Found in experiment/faceplusplus/example_command_merge.go and 2 other locations - About 1 hr to fix
    experiment/aws/example_command_sqs_purge.go on lines 49..60
    experiment/faceplusplus/example_command_merge_target.go on lines 56..67

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

    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 (m *MergeTargetCommand) init() {
        m.listOnce.Do(func() {
            m.whitelist = make(map[string]struct{})
            for _, s := range m.Whitelist {
                m.whitelist[s] = struct{}{}
    Severity: Major
    Found in experiment/faceplusplus/example_command_merge_target.go and 2 other locations - About 1 hr to fix
    experiment/aws/example_command_sqs_purge.go on lines 49..60
    experiment/faceplusplus/example_command_merge.go on lines 55..66

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

    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

    Method DynamoDBCommand.run has 6 return statements (exceeds 4 allowed).
    Open

    func (s DynamoDBCommand) run(d command.CommandData) command.Command {
        c := command.Command{}
    
        ddbCli, err := getOrCreateDynamoDBClient()
        if err != nil {
    Severity: Major
    Found in experiment/aws/example_command_dynamodb.go - About 40 mins to fix

      Method SQSCommand.runSQS has 6 return statements (exceeds 4 allowed).
      Open

      func (s SQSCommand) runSQS(d command.CommandData) command.Command {
          c := command.Command{}
      
          sqsCli, err := getOrCreateSQSClient()
          if err != nil {
      Severity: Major
      Found in experiment/aws/example_command_sqs.go - About 40 mins to fix

        Method SQSPurgeCommand.runSQSPurge has 6 return statements (exceeds 4 allowed).
        Open

        func (s SQSPurgeCommand) runSQSPurge(d command.CommandData) {
            queueName := d.TextOther
            switch {
            case s.isInBlacklist(queueName),
                !s.isInWhitelist(queueName):
        Severity: Major
        Found in experiment/aws/example_command_sqs_purge.go - About 40 mins to fix

          Method MergeCommand.runMergeFace has 5 return statements (exceeds 4 allowed).
          Open

          func (m *MergeCommand) runMergeFace(d command.CommandData) {
              switch {
              case m.isInBlacklist(d.SenderName),
                  !m.isInWhitelist(d.SenderName):
                  _ = command.NewReplyEngineTask(d.Engine, d.Channel, i18n.Message("No!")).Run()
          Severity: Major
          Found in experiment/faceplusplus/example_command_merge.go - About 35 mins to fix

            Method RoomCommand.runRoom has 5 return statements (exceeds 4 allowed).
            Open

            func (a *RoomCommand) runRoom(d command.CommandData) command.Command {
                c := command.Command{}
            
                _, err := getGoogleCalendarClient()
                if err != nil {
            Severity: Major
            Found in experiment/google/example_command_room.go - About 35 mins to fix

              Method MergeTargetCommand.runMergeFace has 5 return statements (exceeds 4 allowed).
              Open

              func (m *MergeTargetCommand) runMergeFace(d command.CommandData) {
                  switch {
                  case m.isInBlacklist(d.SenderName),
                      !m.isInWhitelist(d.SenderName):
                      _ = command.NewReplyEngineTask(d.Engine, d.Channel, i18n.Message("No!")).Run()
              Severity: Major
              Found in experiment/faceplusplus/example_command_merge_target.go - About 35 mins to fix

                exported method SQSPurgeCommand.GetMentionCommand should have comment or be unexported
                Open

                func (SQSPurgeCommand) GetMentionCommand() string {

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

                func (*OpenAIGPTCommand) GetHelp() string {

                exported type CostCommandByCloudWatch should have comment or be unexported
                Open

                type CostCommandByCloudWatch struct {

                exported type CostCommandByCostExplorer should have comment or be unexported
                Open

                type CostCommandByCostExplorer struct {

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

                func (CostCommandByCostExplorer) GetHelp() string {

                exported method OpenAIGPTCommand.Exec should have comment or be unexported
                Open

                func (t *OpenAIGPTCommand) Exec(d command.CommandData) {
                Severity
                Category
                Status
                Source
                Language