hunterlong/statup

View on GitHub

Showing 423 of 423 total issues

File css.js has 753 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

CodeMirror.defineMode("css", function(config, parserConfig) {
  var inline = parserConfig.inline
Severity: Major
Found in frontend/src/assets/js/css.js - About 1 day to fix

    Db has 82 methods (exceeds 20 allowed). Consider refactoring.
    Open

    func (it *Db) ChunkSize() int {
        switch it.Database.Dialect().GetName() {
        case "mysql":
            return 3000
        case "postgres":
    Severity: Major
    Found in database/database.go - About 1 day to fix

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

        CodeMirror.defineMIME("text/x-scss", {
          mediaTypes: mediaTypes,
          mediaFeatures: mediaFeatures,
          mediaValueKeywords: mediaValueKeywords,
          propertyKeywords: propertyKeywords,
      Severity: Major
      Found in frontend/public/js/css.js and 1 other location - About 1 day to fix
      frontend/src/assets/js/css.js on lines 718..759

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

      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

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

        CodeMirror.defineMIME("text/x-scss", {
          mediaTypes: mediaTypes,
          mediaFeatures: mediaFeatures,
          mediaValueKeywords: mediaValueKeywords,
          propertyKeywords: propertyKeywords,
      Severity: Major
      Found in frontend/src/assets/js/css.js and 1 other location - About 1 day to fix
      frontend/public/js/css.js on lines 728..769

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

      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

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

        CodeMirror.defineMIME("text/x-less", {
          mediaTypes: mediaTypes,
          mediaFeatures: mediaFeatures,
          mediaValueKeywords: mediaValueKeywords,
          propertyKeywords: propertyKeywords,
      Severity: Major
      Found in frontend/public/js/css.js and 1 other location - About 1 day to fix
      frontend/src/assets/js/css.js on lines 761..798

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

      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

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

        CodeMirror.defineMIME("text/x-less", {
          mediaTypes: mediaTypes,
          mediaFeatures: mediaFeatures,
          mediaValueKeywords: mediaValueKeywords,
          propertyKeywords: propertyKeywords,
      Severity: Major
      Found in frontend/src/assets/js/css.js and 1 other location - About 1 day to fix
      frontend/public/js/css.js on lines 771..808

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

      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

        it('should create new TCP service', () => {
          cy.visit('/dashboard/create_service')
            cy.get('#name').clear().type('TCP Service')
          cy.get('#service_type').select('tcp')
          cy.get('#service_url').clear().type('localhost')
      Severity: Major
      Found in frontend/cypress/integration/services_spec.js and 1 other location - About 1 day to fix
      frontend/cypress/integration/services_spec.js on lines 64..78

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

      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

        it('should create new UDP service', () => {
          cy.visit('/dashboard/create_service')
            cy.get('#name').clear().type('UDP Service')
          cy.get('#service_type').select('udp')
          cy.get('#service_url').clear().type('8.8.8.8')
      Severity: Major
      Found in frontend/cypress/integration/services_spec.js and 1 other location - About 1 day to fix
      frontend/cypress/integration/services_spec.js on lines 48..62

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

      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

      Api has 63 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Api {
        constructor() {
          this.version = "0.90.74";
          this.commit = "2612402a7782f28ca0b7fc10c941d8c4a1a5acc6";
        }
      Severity: Major
      Found in frontend/src/API.js - About 1 day to fix

        Function importCli has a Cognitive Complexity of 56 (exceeds 20 allowed). Consider refactoring.
        Open

        func importCli(args []string) error {
            var err error
            var data []byte
            if len(args) < 1 {
                return errors.New("invalid command arguments")
        Severity: Minor
        Found in cmd/cli.go - About 6 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

          var colorKeywords_ = [
            "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
            "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
            "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
            "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
        Severity: Major
        Found in frontend/src/assets/js/css.js and 1 other location - About 6 hrs to fix
        frontend/public/js/css.js on lines 564..591

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

        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

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

          var colorKeywords_ = [
            "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
            "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
            "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
            "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
        Severity: Major
        Found in frontend/public/js/css.js and 1 other location - About 6 hrs to fix
        frontend/src/assets/js/css.js on lines 554..581

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

        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

        `` has 42 functions (exceeds 20 allowed). Consider refactoring.
        Open

          methods: {
            now() {
              return new Date()
            },
            isNumeric: function (n) {
        Severity: Minor
        Found in frontend/src/mixin.js - About 5 hrs to fix

          Identical blocks of code found in 6 locations. Consider refactoring.
          Open

            it('should Login', () => {
              cy.visit('/login')
              cy.get('#username').clear().type('admin')
              cy.get('#password').clear().type('admin')
              cy.get('button[type="submit"]').click()
          Severity: Major
          Found in frontend/cypress/integration/messages_spec.js and 5 other locations - About 5 hrs to fix
          frontend/cypress/integration/groups_spec.js on lines 16..26
          frontend/cypress/integration/incidents_spec.js on lines 15..25
          frontend/cypress/integration/services_spec.js on lines 15..25
          frontend/cypress/integration/settings_spec.js on lines 16..26
          frontend/cypress/integration/users_spec.js on lines 16..26

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

          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

          Identical blocks of code found in 6 locations. Consider refactoring.
          Open

            it('should Login', () => {
              cy.visit('/login')
              cy.get('#username').clear().type('admin')
              cy.get('#password').clear().type('admin')
              cy.get('button[type="submit"]').click()
          Severity: Major
          Found in frontend/cypress/integration/services_spec.js and 5 other locations - About 5 hrs to fix
          frontend/cypress/integration/groups_spec.js on lines 16..26
          frontend/cypress/integration/incidents_spec.js on lines 15..25
          frontend/cypress/integration/messages_spec.js on lines 16..26
          frontend/cypress/integration/settings_spec.js on lines 16..26
          frontend/cypress/integration/users_spec.js on lines 16..26

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

          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

          Identical blocks of code found in 6 locations. Consider refactoring.
          Open

            it('should Login', () => {
              cy.visit('/login')
              cy.get('#username').clear().type('admin')
              cy.get('#password').clear().type('admin')
              cy.get('button[type="submit"]').click()
          Severity: Major
          Found in frontend/cypress/integration/settings_spec.js and 5 other locations - About 5 hrs to fix
          frontend/cypress/integration/groups_spec.js on lines 16..26
          frontend/cypress/integration/incidents_spec.js on lines 15..25
          frontend/cypress/integration/messages_spec.js on lines 16..26
          frontend/cypress/integration/services_spec.js on lines 15..25
          frontend/cypress/integration/users_spec.js on lines 16..26

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

          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

          Identical blocks of code found in 6 locations. Consider refactoring.
          Open

            it('should Login', () => {
              cy.visit('/login')
              cy.get('#username').clear().type('admin')
              cy.get('#password').clear().type('admin')
              cy.get('button[type="submit"]').click()
          Severity: Major
          Found in frontend/cypress/integration/users_spec.js and 5 other locations - About 5 hrs to fix
          frontend/cypress/integration/groups_spec.js on lines 16..26
          frontend/cypress/integration/incidents_spec.js on lines 15..25
          frontend/cypress/integration/messages_spec.js on lines 16..26
          frontend/cypress/integration/services_spec.js on lines 15..25
          frontend/cypress/integration/settings_spec.js on lines 16..26

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

          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

          Identical blocks of code found in 6 locations. Consider refactoring.
          Open

            it('should Login', () => {
              cy.visit('/login')
              cy.get('#username').clear().type('admin')
              cy.get('#password').clear().type('admin')
              cy.get('button[type="submit"]').click()
          Severity: Major
          Found in frontend/cypress/integration/incidents_spec.js and 5 other locations - About 5 hrs to fix
          frontend/cypress/integration/groups_spec.js on lines 16..26
          frontend/cypress/integration/messages_spec.js on lines 16..26
          frontend/cypress/integration/services_spec.js on lines 15..25
          frontend/cypress/integration/settings_spec.js on lines 16..26
          frontend/cypress/integration/users_spec.js on lines 16..26

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

          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

          Identical blocks of code found in 6 locations. Consider refactoring.
          Open

            it('should Login', () => {
              cy.visit('/login')
              cy.get('#username').clear().type('admin')
              cy.get('#password').clear().type('admin')
              cy.get('button[type="submit"]').click()
          Severity: Major
          Found in frontend/cypress/integration/groups_spec.js and 5 other locations - About 5 hrs to fix
          frontend/cypress/integration/incidents_spec.js on lines 15..25
          frontend/cypress/integration/messages_spec.js on lines 16..26
          frontend/cypress/integration/services_spec.js on lines 15..25
          frontend/cypress/integration/settings_spec.js on lines 16..26
          frontend/cypress/integration/users_spec.js on lines 16..26

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

          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 defineOptions has 116 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function defineOptions(CodeMirror) {
            var optionHandlers = CodeMirror.optionHandlers
          
            function option(name, deflt, handle, notOnInit) {
              CodeMirror.defaults[name] = deflt
          Severity: Major
          Found in frontend/public/js/codemirror.js - About 4 hrs to fix
            Severity
            Category
            Status
            Source
            Language