hunterlong/statup

View on GitHub

Showing 284 of 423 total issues

Function patchDisplay has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function patchDisplay(cm, updateNumbersFrom, dims) {
  var display = cm.display, lineNumbers = cm.options.lineNumbers
  var container = display.lineDiv, cur = container.firstChild

  function rm(node) {
Severity: Minor
Found in frontend/public/js/codemirror.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

        if (context.line >= cm.display.viewFrom) { // Visible
          var oldStyles = line.styles
          var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null
          var highlighted = highlightLine(cm, line, context, true)
          if (resetState) { context.state = resetState }
    Severity: Critical
    Found in frontend/public/js/codemirror.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

          if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&
              (sp.to == null || sp.to != span.from) &&
              (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&
              lineIsHiddenInner(doc, line, sp)) { return true }
      Severity: Critical
      Found in frontend/public/js/codemirror.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

          if (this.contextMenuPending || !cm.state.focused ||
              (hasSelection(input) && !prevInput && !this.composing) ||
              cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)
            { return false }
        Severity: Critical
        Found in frontend/public/js/codemirror.js - About 1 hr to fix

          Function runMode has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {
            var flattenSpans = mode.flattenSpans
            if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans }
            var curStart = 0, curStyle = null
            var stream = new StringStream(text, cm.options.tabSize, context), style
          Severity: Minor
          Found in frontend/public/js/codemirror.js - About 1 hr to fix

            Function addChangeToHistory has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function addChangeToHistory(doc, change, selAfter, opId) {
              var hist = doc.history
              hist.undone.length = 0
              var time = +new Date, cur
              var last
            Severity: Minor
            Found in frontend/public/js/codemirror.js - About 1 hr to fix

              Function nodeAndOffsetInLineMap has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function nodeAndOffsetInLineMap(map, ch, bias) {
                var node, start, end, collapse, mStart, mEnd
                // First, search the line map for the text node corresponding to,
                // or closest to, the target character.
                for (var i = 0; i < map.length; i += 3) {
              Severity: Minor
              Found in frontend/public/js/codemirror.js - About 1 hr to fix

                Function iconName has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    iconName(name) {
                      switch (name) {
                        case "fas fa-terminal":
                          return "terminal"
                        case "fab fa-discord":
                Severity: Minor
                Found in frontend/src/mixin.js - About 1 hr to fix

                  Function leftButtonStartDrag has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function leftButtonStartDrag(cm, event, pos, behavior) {
                    var display = cm.display, moved = false
                    var dragEnd = operation(cm, function (e) {
                      if (webkit) { display.scroller.draggable = false }
                      cm.state.draggingText = false
                  Severity: Minor
                  Found in frontend/public/js/codemirror.js - About 1 hr to fix

                    Function poll has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    TextareaInput.prototype.poll = function () {
                        var this$1 = this;
                    
                      var cm = this.cm, input = this.textarea, prevInput = this.prevInput
                      // Since this is called a *lot*, try to bail out as cheaply as
                    Severity: Minor
                    Found in frontend/public/js/codemirror.js - About 1 hr to fix

                      Function parseError has 13 return statements (exceeds 4 allowed).
                      Open

                      func parseError(f *failures.Failure) string {
                          if f.Method == "checkin" {
                              return fmt.Sprintf("Checkin is Offline")
                          }
                          err := strings.Contains(f.Issue, "connection reset by peer")
                      Severity: Major
                      Found in types/services/failures.go - About 1 hr to fix

                        Function top has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          states.top = function(type, stream, state) {
                            if (type == "{") {
                              return pushContext(state, stream, "block");
                            } else if (type == "}" && state.context.prev) {
                              return popContext(state);
                        Severity: Minor
                        Found in frontend/public/js/css.js - About 1 hr to fix

                          Function settingsImportHandler has 56 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func settingsImportHandler(w http.ResponseWriter, r *http.Request) {
                              data, err := ioutil.ReadAll(r.Body)
                              if err != nil {
                                  sendErrorJson(err, w, r)
                                  return
                          Severity: Minor
                          Found in handlers/dashboard.go - About 1 hr to fix

                            Function top has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              states.top = function(type, stream, state) {
                                if (type == "{") {
                                  return pushContext(state, stream, "block");
                                } else if (type == "}" && state.context.prev) {
                                  return popContext(state);
                            Severity: Minor
                            Found in frontend/src/assets/js/css.js - About 1 hr to fix

                              Function addWidget has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  addWidget: function(pos, node, scroll, vert, horiz) {
                                    var display = this.display
                                    pos = cursorCoords(this, clipPos(this.doc, pos))
                                    var top = pos.bottom, left = pos.left
                                    node.style.position = "absolute"
                              Severity: Minor
                              Found in frontend/public/js/codemirror.js - About 1 hr to fix

                                Function ParseQueries has 54 lines of code (exceeds 50 allowed). Consider refactoring.
                                Open

                                func ParseQueries(r *http.Request, o isObject) (*GroupQuery, error) {
                                    fields := parseGet(r)
                                    grouping := fields.Get("group")
                                    startField := utils.ToInt(fields.Get("start"))
                                    endField := utils.ToInt(fields.Get("end"))
                                Severity: Minor
                                Found in database/grouping.go - About 1 hr to fix

                                  Function LoadConfigForm has 54 lines of code (exceeds 50 allowed). Consider refactoring.
                                  Open

                                  func LoadConfigForm(r *http.Request) (*DbConfig, error) {
                                      if err := r.ParseForm(); err != nil {
                                          return nil, err
                                      }
                                      g := r.PostForm.Get
                                  Severity: Minor
                                  Found in types/configs/configs_form.go - About 1 hr to fix

                                    Function update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    NativeScrollbars.prototype.update = function (measure) {
                                      var needsH = measure.scrollWidth > measure.clientWidth + 1
                                      var needsV = measure.scrollHeight > measure.clientHeight + 1
                                      var sWidth = measure.nativeBarWidth
                                    
                                    
                                    Severity: Minor
                                    Found in frontend/public/js/codemirror.js - About 1 hr to fix

                                      Function CheckTcp has 53 lines of code (exceeds 50 allowed). Consider refactoring.
                                      Open

                                      func CheckTcp(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 1 hr to fix

                                        Function processSetupHandler has 11 return statements (exceeds 4 allowed).
                                        Open

                                        func processSetupHandler(w http.ResponseWriter, r *http.Request) {
                                            var err error
                                            if core.App.Setup {
                                                sendErrorJson(errors.New("Statping has already been setup"), w, r)
                                                return
                                        Severity: Major
                                        Found in handlers/setup.go - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language