eisen-dev/eisen_front

View on GitHub
webd/includes/notify/notify.js

Summary

Maintainability
D
2 days
Test Coverage

Showing 6 of 6 total issues

File notify.js has 565 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
* Eisen Frontend
* http://eisen-dev.github.io
*
* Copyright (c) 2016 Alice Ferrazzi <alice.ferrazzi@gmail.com> - Takuma Muramatsu <t.muramatu59@gmail.com>
Severity: Major
Found in webd/includes/notify/notify.js - About 1 day to fix

    Function setElementPosition has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Notification.prototype.setElementPosition = function() {
    var arrowColor, arrowCss, arrowSize, color, contH, contW, css, elemH, elemIH, elemIW, elemPos, elemW, gap, j, k, len, len1, mainFull, margin, opp, oppFull, pAlign, pArrow, pMain, pos, posFull, position, ref, wrapPos;
    position = this.getPosition();
    pMain = position[0];
    pAlign = position[1];
    Severity: Major
    Found in webd/includes/notify/notify.js - About 2 hrs to fix

      Function run has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Notification.prototype.run = function(data, options) {
      var d, datas, name, type, value;
      if ($.isPlainObject(options)) {
      $.extend(this.options, options);
      } else if ($.type(options) === "string") {
      Severity: Minor
      Found in webd/includes/notify/notify.js - About 1 hr to fix

        Function addStyle has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var addStyle = function(name, def) {
        if (!name) {
        throw "Missing Style name";
        }
        if (!def) {
        Severity: Minor
        Found in webd/includes/notify/notify.js - About 1 hr to fix

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

          Notification.prototype.show = function(show, userCallback) {
          var args, callback, elems, fn, hidden;
          callback = (function(_this) {
          return function() {
          if (!show && !_this.elem) {
          Severity: Minor
          Found in webd/includes/notify/notify.js - About 1 hr to fix

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

            if (pos.length === 1 || ((ref1 = pos[0], indexOf.call(vAligns, ref1) >= 0) && (ref2 = pos[1], indexOf.call(hAligns, ref2) < 0)) || ((ref3 = pos[0], indexOf.call(hAligns, ref3) >= 0) && (ref4 = pos[1], indexOf.call(vAligns, ref4) < 0))) {
            Severity: Minor
            Found in webd/includes/notify/notify.js and 1 other location - About 55 mins to fix
            webd/includes/notify/notify.js on lines 446..446
            Category
            Status