hunterlong/statup

View on GitHub

Showing 284 of 423 total issues

File codemirror.js has 7702 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

// This is CodeMirror (http://codemirror.net), a code editor
// implemented in JavaScript on top of the browser's DOM.
Severity: Major
Found in frontend/public/js/codemirror.js - About 3 wks to fix

    Function addEditorMethods has 378 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function addEditorMethods(CodeMirror) {
      var optionHandlers = CodeMirror.optionHandlers
    
      var helpers = CodeMirror.helpers = {}
    
    
    Severity: Major
    Found in frontend/public/js/codemirror.js - About 1 day to fix

      File css.js has 763 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
      
      (function(mod) {
        if (typeof exports == "object" && typeof module == "object") // CommonJS
      Severity: Major
      Found in frontend/public/js/css.js - About 1 day to fix

        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

            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

              `` 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

                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

                  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

                      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

                        `` 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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language