hunterlong/statup

View on GitHub

Showing 423 of 423 total issues

Function rangePlugin has 115 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function rangePlugin(config) {
      if (config === void 0) {
        config = {};
      }

Severity: Major
Found in frontend/public/js/rangePlugin.js - About 4 hrs to fix

    Function rangePlugin has 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function rangePlugin(config) {
          if (config === void 0) {
            config = {};
          }
    
    
    Severity: Major
    Found in frontend/src/assets/js/rangePlugin.js - About 4 hrs to fix

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

        CodeMirror.defineMIME("text/x-gss", {
          documentTypes: documentTypes,
          mediaTypes: mediaTypes,
          mediaFeatures: mediaFeatures,
          propertyKeywords: propertyKeywords,
      Severity: Major
      Found in frontend/src/assets/js/css.js and 1 other location - About 4 hrs to fix
      frontend/public/js/css.js on lines 810..830

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

      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-gss", {
          documentTypes: documentTypes,
          mediaTypes: mediaTypes,
          mediaFeatures: mediaFeatures,
          propertyKeywords: propertyKeywords,
      Severity: Major
      Found in frontend/public/js/css.js and 1 other location - About 4 hrs to fix
      frontend/src/assets/js/css.js on lines 800..820

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

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

      function leftButtonSelect(cm, event, start, behavior) {
        var display = cm.display, doc = cm.doc
        e_preventDefault(event)
      
        var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges
      Severity: Major
      Found in frontend/public/js/codemirror.js - About 4 hrs to fix

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

          CodeMirror.defineMIME("text/css", {
            documentTypes: documentTypes,
            mediaTypes: mediaTypes,
            mediaFeatures: mediaFeatures,
            mediaValueKeywords: mediaValueKeywords,
        Severity: Major
        Found in frontend/public/js/css.js and 1 other location - About 4 hrs to fix
        frontend/src/assets/js/css.js on lines 697..716

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

        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/css", {
            documentTypes: documentTypes,
            mediaTypes: mediaTypes,
            mediaFeatures: mediaFeatures,
            mediaValueKeywords: mediaValueKeywords,
        Severity: Major
        Found in frontend/src/assets/js/css.js and 1 other location - About 4 hrs to fix
        frontend/public/js/css.js on lines 707..726

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

        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 34 functions (exceeds 20 allowed). Consider refactoring.
        Open

          getters: {
            hasAllData: state => state.hasAllData,
            hasPublicData: state => state.hasPublicData,
            admin: state => state.admin,
            core: state => state.core,
        Severity: Minor
        Found in frontend/src/store.js - About 4 hrs to fix

          Function bidiOrdering has 100 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var bidiOrdering = (function() {
            // Character types for codepoints 0 to 0xff
            var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"
            // Character types for codepoints 0x600 to 0x6f9
            var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"
          Severity: Major
          Found in frontend/public/js/codemirror.js - About 4 hrs to fix

            Function Samples has 122 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func Samples() error {
                log.Infoln("Inserting Sample Services...")
                createdOn := utils.Now().Add(((-24 * 30) * 3) * time.Hour)
                s1 := &Service{
                    Name:           "Google",
            Severity: Major
            Found in types/services/samples.go - About 3 hrs to fix

              Function Router has 120 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func Router() *mux.Router {
                  dir := utils.Directory
              
                  r := mux.NewRouter().StrictSlash(true)
                  r.Use(prometheusMiddleware)
              Severity: Major
              Found in handlers/routes.go - About 3 hrs to fix

                Function registerEventHandlers has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function registerEventHandlers(cm) {
                  var d = cm.display
                  on(d.scroller, "mousedown", operation(cm, onMouseDown))
                  // Older IE's will not fire a second mousedown for a double click
                  if (ie && ie_version < 11)
                Severity: Major
                Found in frontend/public/js/codemirror.js - About 3 hrs to fix

                  File database.go has 560 lines of code (exceeds 500 allowed). Consider refactoring.
                  Open

                  package database
                  
                  import (
                      "database/sql"
                      "fmt"
                  Severity: Minor
                  Found in database/database.go - About 3 hrs to fix

                    Function importCli has 109 lines of code (exceeds 50 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: Major
                    Found in cmd/cli.go - About 3 hrs to fix

                      Function drawSelectionRange has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function drawSelectionRange(cm, range, output) {
                        var display = cm.display, doc = cm.doc
                        var fragment = document.createDocumentFragment()
                        var padding = paddingH(cm.display), leftSide = padding.left
                        var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right
                      Severity: Major
                      Found in frontend/public/js/codemirror.js - About 3 hrs to fix

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

                            rect = {left: Math.min(coords.left, endCoords.left),
                                    top: Math.min(coords.top, endCoords.top) - margin,
                                    right: Math.max(coords.left, endCoords.left),
                                    bottom: Math.max(coords.bottom, endCoords.bottom) + margin}
                        Severity: Major
                        Found in frontend/public/js/codemirror.js and 1 other location - About 3 hrs to fix
                        frontend/public/js/codemirror.js on lines 3493..3498

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

                        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

                          var sPos = calculateScrollPos(cm, {
                            left: Math.min(from.left, to.left),
                            top: Math.min(from.top, to.top) - margin,
                            right: Math.max(from.right, to.right),
                            bottom: Math.max(from.bottom, to.bottom) + margin
                        Severity: Major
                        Found in frontend/public/js/codemirror.js and 1 other location - About 3 hrs to fix
                        frontend/public/js/codemirror.js on lines 3394..3397

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

                        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 CheckGrpc has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring.
                        Open

                        func CheckGrpc(s *Service, record bool) (*Service, error) {
                            defer s.updateLastCheck()
                            timer := prometheus.NewTimer(metrics.ServiceTimer(s.Name))
                            defer timer.ObserveDuration()
                        
                        
                        Severity: Minor
                        Found in types/services/routine.go - About 3 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

                                query.map((d) => {
                                    if (high <= d.amount) {
                                        high = d.amount
                                    }
                                    if (low >= d.amount && d.amount !== 0) {
                        Severity: Major
                        Found in frontend/src/graphing.js and 1 other location - About 2 hrs to fix
                        frontend/src/graphing.js on lines 24..32

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

                        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

                                query.map((d) => {
                                    if (high <= d.amount) {
                                        high = d.amount
                                    }
                                    if (low >= d.amount && d.amount !== 0) {
                        Severity: Major
                        Found in frontend/src/graphing.js and 1 other location - About 2 hrs to fix
                        frontend/src/graphing.js on lines 42..50

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

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language