hunterlong/statup

View on GitHub

Showing 423 of 423 total issues

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

  async notifier_test(data, notifier) {
    return axios.post('api/notifier/' + notifier + '/test', data).then(response => (response.data))
  }
Severity: Minor
Found in frontend/src/API.js and 1 other location - About 35 mins to fix
frontend/src/API.js on lines 147..149

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

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 Find(id int64) (*Message, error) {
    var message Message
    q := db.Where("id = ?", id).Find(&message)
    if q.Error() != nil {
        return nil, errors.Missing(message, id)
Severity: Minor
Found in types/messages/database.go and 1 other location - About 30 mins to fix
types/groups/database.go on lines 51..58

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

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 Find(id int64) (*Group, error) {
    var group Group
    q := db.Where("id = ?", id).Find(&group)
    if q.Error() != nil {
        return nil, errors.Missing(group, id)
Severity: Minor
Found in types/groups/database.go and 1 other location - About 30 mins to fix
types/messages/database.go on lines 18..25

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

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

Avoid too many return statements within this function.
Open

        return ret("number", "unit");
Severity: Major
Found in frontend/public/js/css.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return ret("property", "word");
    Severity: Major
    Found in frontend/public/js/css.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return "maybeprop";
      Severity: Major
      Found in frontend/public/js/css.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return "parens";
        Severity: Major
        Found in frontend/public/js/css.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return ret("qualifier", "qualifier");
          Severity: Major
          Found in frontend/public/js/css.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return pushContext(state, stream, "at");
            Severity: Major
            Found in frontend/public/js/css.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return "block";
              Severity: Major
              Found in frontend/public/js/css.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return ret("keyword", "important");
                Severity: Major
                Found in frontend/public/js/css.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return ret(null, "select-op");
                  Severity: Major
                  Found in frontend/public/js/css.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return "pseudo";
                    Severity: Major
                    Found in frontend/public/js/css.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return ret("meta", "meta");
                      Severity: Major
                      Found in frontend/public/js/css.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return "restricted_atBlock_before";
                        Severity: Major
                        Found in frontend/public/js/css.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return ret("number", "unit");
                          Severity: Major
                          Found in frontend/public/js/css.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return ret(null, ch);
                            Severity: Major
                            Found in frontend/public/js/css.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return pushContext(state, stream, "parens");
                              Severity: Major
                              Found in frontend/public/js/css.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                    return state.context.type;
                                Severity: Major
                                Found in frontend/public/js/css.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return pushContext(state, stream, "atBlock");
                                  Severity: Major
                                  Found in frontend/public/js/css.js - About 30 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language