HerbCSO/ticketeer

View on GitHub

Showing 181 of 292 total issues

Function pathBBox has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var pathDimensions = R.pathBBox = function (path) {
        var pth = paths(path);
        if (pth.bbox) {
            return clone(pth.bbox);
        }
Severity: Minor
Found in app/assets/javascripts/raphael.js - About 1 hr to fix

    Function drawSeries has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Bar.prototype.drawSeries = function() {
          var barWidth, bottom, groupWidth, idx, lastTop, left, leftPadding, numBars, row, sidx, size, top, ypos, zeroPos;
          groupWidth = this.width / this.options.data.length;
          numBars = this.options.stacked != null ? 1 : this.options.ykeys.length;
          barWidth = (groupWidth * this.options.barSizeRatio - this.options.barGap * (numBars - 1)) / numBars;
    Severity: Minor
    Found in app/assets/javascripts/morris.js - About 1 hr to fix

      Method bootstrap_flash_fixed has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        def bootstrap_flash_fixed
          flash_messages = []
          flash.each do |type, message|
            type = type.to_sym # this is needed because it comes in as a String for some reason...
            # Skip empty messages, e.g. for devise messages set to nothing in a locale file.
      Severity: Minor
      Found in app/helpers/bootstrap_flash_helper.rb - About 1 hr 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

      Function create has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          R._engine.create = function () {
              var con = R._getContainer.apply(0, arguments),
                  container = con && con.container,
                  x = con.x,
                  y = con.y,
      Severity: Minor
      Found in app/assets/javascripts/raphael.js - About 1 hr to fix

        Function generatePaths has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Line.prototype.generatePaths = function() {
              var c, coords, i, r, smooth;
              return this.paths = (function() {
                var _i, _ref, _ref1, _results;
                _results = [];
        Severity: Minor
        Found in app/assets/javascripts/morris.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                      if (rgb[5]) {
                          values = rgb[5][split](commaSpaces);
                          red = toFloat(values[0]);
                          values[0].slice(-1) == "%" && (red *= 2.55);
                          green = toFloat(values[1]);
          Severity: Critical
          Found in app/assets/javascripts/raphael.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                        if (rgb[6]) {
                            values = rgb[6][split](commaSpaces);
                            red = toFloat(values[0]);
                            values[0].slice(-1) == "%" && (red *= 2.55);
                            green = toFloat(values[1]);
            Severity: Critical
            Found in app/assets/javascripts/raphael.js - About 1 hr to fix

              Function _calc has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  Grid.prototype._calc = function() {
                    var bottomOffsets, gridLine, h, i, w, yLabelWidths;
                    w = this.el.width();
                    h = this.el.height();
                    if (this.elementWidth !== w || this.elementHeight !== h || this.dirty) {
              Severity: Minor
              Found in app/assets/javascripts/morris.js - About 1 hr to fix

                Function curveDim has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        curveDim = cacher(function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
                            var a = (c2x - 2 * c1x + p1x) - (p2x - 2 * c2x + c1x),
                                b = 2 * (c1x - p1x) - 2 * (c2x - c1x),
                                c = p1x - c1x,
                                t1 = (-b + math.sqrt(b * b - 4 * a * c)) / 2 / a,
                Severity: Minor
                Found in app/assets/javascripts/raphael.js - About 1 hr to fix

                  Function create has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      R._engine.create = function () {
                          var con = R._getContainer.apply(0, arguments),
                              container = con.container,
                              height = con.height,
                              s,
                  Severity: Minor
                  Found in app/assets/javascripts/raphael.js - About 1 hr to fix

                    Function transform has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        elproto.transform = function (tstr) {
                            if (tstr == null) {
                                return this._.transform;
                            }
                            var vbs = this.paper._viewBoxShift,
                    Severity: Minor
                    Found in app/assets/javascripts/raphael.js - About 1 hr to fix

                      Function text has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          R._engine.text = function (vml, x, y, text) {
                              var el = createNode("shape"),
                                  path = createNode("path"),
                                  o = createNode("textpath");
                              x = x || 0;
                      Severity: Minor
                      Found in app/assets/javascripts/raphael.js - About 1 hr to fix

                        Function getLengthFactory has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            getLengthFactory = function (istotal, subpath) {
                                return function (path, length, onlystart) {
                                    path = path2curve(path);
                                    var x, y, p, l, sp = "", subpaths = {}, point,
                                        len = 0;
                        Severity: Minor
                        Found in app/assets/javascripts/raphael.js - About 1 hr to fix

                          Function setCoords has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  setCoords = function (p, sx, sy, dx, dy, deg) {
                                      var _ = p._,
                                          m = p.matrix,
                                          fillpos = _.fillpos,
                                          o = p.node,
                          Severity: Minor
                          Found in app/assets/javascripts/raphael.js - About 1 hr to fix

                            Function paths has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  return this.paths = (function() {
                                    var _i, _ref, _ref1, _results;
                                    _results = [];
                                    for (i = _i = 0, _ref = this.options.ykeys.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
                                      smooth = this.options.smooth === true || (_ref1 = this.options.ykeys[i], __indexOf.call(this.options.smooth, _ref1) >= 0);
                            Severity: Minor
                            Found in app/assets/javascripts/morris.js - About 1 hr to fix

                              Function dragMove has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  dragMove = function (e) {
                                      var x = e.clientX,
                                          y = e.clientY,
                                          scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop,
                                          scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft,
                              Severity: Minor
                              Found in app/assets/javascripts/raphael.js - About 1 hr to fix

                                Function bars has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      return this.bars = (function() {
                                        var _i, _len, _ref, _results;
                                        _ref = this.data;
                                        _results = [];
                                        for (idx = _i = 0, _len = _ref.length; _i < _len; idx = ++_i) {
                                Severity: Minor
                                Found in app/assets/javascripts/morris.js - About 1 hr to fix

                                  Function registerFont has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      R.registerFont = function (font) {
                                          if (!font.face) {
                                              return font;
                                          }
                                          this.fonts = this.fonts || {};
                                  Severity: Minor
                                  Found in app/assets/javascripts/raphael.js - About 1 hr to fix

                                    Function print has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        paperproto.print = function (x, y, string, font, size, origin, letter_spacing, line_spacing) {
                                            origin = origin || "middle"; // baseline|middle
                                            letter_spacing = mmax(mmin(letter_spacing || 0, 1), -1);
                                            line_spacing = mmax(mmin(line_spacing || 1, 3), 1);
                                            var letters = Str(string)[split](E),
                                    Severity: Minor
                                    Found in app/assets/javascripts/raphael.js - About 1 hr to fix

                                      Function parsePathString has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          R.parsePathString = function (pathString) {
                                              if (!pathString) {
                                                  return null;
                                              }
                                              var pth = paths(pathString);
                                      Severity: Minor
                                      Found in app/assets/javascripts/raphael.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language