hunterlong/statup

View on GitHub

Showing 423 of 423 total issues

Function regChange has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function regChange(cm, from, to, lendiff) {
  if (from == null) { from = cm.doc.first }
  if (to == null) { to = cm.doc.first + cm.doc.size }
  if (!lendiff) { lendiff = 0 }

Severity: Major
Found in frontend/public/js/codemirror.js - About 2 hrs to fix

    File mixin.js has 260 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import Vue from "vue";
    const { startOfDay, startOfHour, startOfWeek, endOfMonth, endOfHour, startOfToday, startOfTomorrow, startOfYesterday, endOfYesterday, endOfTomorrow, endOfToday, endOfDay, startOfMonth, lastDayOfMonth, subSeconds, getUnixTime, fromUnixTime, differenceInSeconds, formatDistance, addMonths, addSeconds, isWithinInterval } = require('date-fns')
    import formatDistanceToNow from 'date-fns/formatDistanceToNow'
    import format from 'date-fns/format'
    import parseISO from 'date-fns/parseISO'
    Severity: Minor
    Found in frontend/src/mixin.js - About 2 hrs to fix

      Function HttpRequest has 80 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func HttpRequest(endpoint, method string, contentType interface{}, headers []string, body io.Reader, timeout time.Duration, verifySSL bool, customTLS *tls.Config) ([]byte, *http.Response, error) {
          var err error
          var req *http.Request
          if method == "" {
              method = "GET"
      Severity: Major
      Found in utils/utils.go - About 2 hrs to fix

        Function makeChangeFromHistory has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function makeChangeFromHistory(doc, type, allowSelectionOnly) {
          var suppress = doc.cm && doc.cm.state.suppressEdits
          if (suppress && !allowSelectionOnly) { return }
        
          var hist = doc.history, event, selAfter = doc.sel
        Severity: Major
        Found in frontend/public/js/codemirror.js - About 2 hrs to fix

          Function CheckHttp has 78 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func CheckHttp(s *Service, record bool) (*Service, error) {
              defer s.updateLastCheck()
              timer := prometheus.NewTimer(metrics.ServiceTimer(s.Name))
              defer timer.ObserveDuration()
          
          
          Severity: Major
          Found in types/services/routine.go - About 2 hrs to fix

            Function markText has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function markText(doc, from, to, options, type) {
              // Shared markers (across linked documents) are handled separately
              // (markTextShared will call out to this again, once per
              // document).
              if (options && options.shared) { return markTextShared(doc, from, to, options, type) }
            Severity: Major
            Found in frontend/public/js/codemirror.js - About 2 hrs to fix

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

                if (sizes.right && sizes.bottom) {
                  d.scrollbarFiller.style.display = "block"
                  d.scrollbarFiller.style.height = sizes.bottom + "px"
                  d.scrollbarFiller.style.width = sizes.right + "px"
                } else { d.scrollbarFiller.style.display = "" }
              Severity: Major
              Found in frontend/public/js/codemirror.js and 1 other location - About 2 hrs to fix
              frontend/public/js/codemirror.js on lines 3683..3687

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

              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

                if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
                  d.gutterFiller.style.display = "block"
                  d.gutterFiller.style.height = sizes.bottom + "px"
                  d.gutterFiller.style.width = measure.gutterWidth + "px"
                } else { d.gutterFiller.style.display = "" }
              Severity: Major
              Found in frontend/public/js/codemirror.js and 1 other location - About 2 hrs to fix
              frontend/public/js/codemirror.js on lines 3678..3682

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

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

              function onDrop(e) {
                var cm = this
                clearDragCursor(cm)
                if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))
                  { return }
              Severity: Major
              Found in frontend/public/js/codemirror.js - About 2 hrs to fix

                Function findPosH has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function findPosH(doc, pos, dir, unit, visually) {
                  var oldPos = pos
                  var origDir = dir
                  var lineObj = getLine(doc, pos.line)
                  function findNextLine() {
                Severity: Major
                Found in frontend/public/js/codemirror.js - About 2 hrs to fix

                  Function CodeMirror has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function CodeMirror(place, options) {
                    var this$1 = this;
                  
                    if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }
                  
                  
                  Severity: Major
                  Found in frontend/public/js/codemirror.js - About 2 hrs to fix

                    Function tokenBase has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function tokenBase(stream, state) {
                        var ch = stream.next();
                        if (tokenHooks[ch]) {
                          var result = tokenHooks[ch](stream, state);
                          if (result !== false) return result;
                    Severity: Minor
                    Found in frontend/public/js/css.js - About 2 hrs to fix

                      Function moveVisually has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function moveVisually(cm, line, start, dir) {
                        var bidi = getOrder(line, cm.doc.direction)
                        if (!bidi) { return moveLogically(line, start, dir) }
                        if (start.ch >= line.text.length) {
                          start.ch = line.text.length
                      Severity: Minor
                      Found in frontend/public/js/codemirror.js - About 2 hrs to fix

                        Function onScrollWheel has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function onScrollWheel(cm, e) {
                          var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y
                        
                          var display = cm.display, scroll = display.scroller
                          // Quit if there's nothing to scroll here
                        Severity: Minor
                        Found in frontend/public/js/codemirror.js - About 2 hrs to fix

                          Function tokenBase has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function tokenBase(stream, state) {
                              var ch = stream.next();
                              if (tokenHooks[ch]) {
                                var result = tokenHooks[ch](stream, state);
                                if (result !== false) return result;
                          Severity: Minor
                          Found in frontend/src/assets/js/css.js - About 2 hrs to fix

                            Function Display has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function Display(place, doc, input) {
                              var d = this
                              this.input = input
                            
                              // Covers bottom-right square when both scrollbars are present.
                            Severity: Minor
                            Found in frontend/public/js/codemirror.js - About 2 hrs to fix

                              Consider simplifying this complex logical expression.
                              Open

                                    } else if (stream.match(".Id") || stream.match(".Domain") || stream.match(".CreatedAt") ||
                                      stream.match(".Name") || stream.match(".Downtime.Human") || stream.match(".Issue") || stream.match(".LastStatusCode") ||
                                      stream.match(".Port") || stream.match(".FailuresLast24Hours") || stream.match(".PingTime")) {
                                      return "var-sub-highlight"
                                    } else if (stream.match("{{") || stream.match("}}")) {
                              Severity: Critical
                              Found in frontend/src/codemirror_json.js - About 2 hrs to fix

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

                                func Samples() error {
                                    log.Infoln("Inserting Sample Incidents...")
                                    incident1 := &Incident{
                                        Title:       "Github Issues",
                                        Description: "There are new features for Statping, if you have any issues please visit the Github Repo.",
                                Severity: Minor
                                Found in types/incidents/samples.go - About 1 hr to fix

                                  Function updateDisplayIfNeeded has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function updateDisplayIfNeeded(cm, update) {
                                    var display = cm.display, doc = cm.doc
                                  
                                    if (update.editorIsHidden) {
                                      resetView(cm)
                                  Severity: Minor
                                  Found in frontend/public/js/codemirror.js - About 1 hr to fix

                                    Function locateNodeInLineView has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function locateNodeInLineView(lineView, node, offset) {
                                      var wrapper = lineView.text.firstChild, bad = false
                                      if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }
                                      if (node == wrapper) {
                                        bad = true
                                    Severity: Minor
                                    Found in frontend/public/js/codemirror.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language