Showing 5,781 of 10,536 total issues

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

    def on_put(req, resp, id_, pid):
        """Handles PUT requests"""
        admin_control(req)
        if not id_.isdigit() or int(id_) <= 0:
            raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
Severity: Minor
Found in myems-api/core/combinedequipment.py - About 1 hr to fix

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

        def on_post(req, resp):
            """Handles POST requests"""
            admin_control(req)
            try:
                raw_json = req.stream.read().decode('utf-8')
    Severity: Minor
    Found in myems-api/core/combinedequipment.py - About 1 hr to fix

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

          def on_put(req, resp, id_, pid):
              """Handles PUT requests"""
              admin_control(req)
              try:
                  raw_json = req.stream.read().decode('utf-8')
      Severity: Minor
      Found in myems-api/core/microgrid.py - About 1 hr to fix

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

            def on_delete(req, resp, id_):
                admin_control(req)
                if not id_.isdigit() or int(id_) <= 0:
                    raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                           description='API.INVALID_VIRTUAL_METER_ID')
        Severity: Minor
        Found in myems-api/core/virtualmeter.py - About 1 hr to fix

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

              def on_put(req, resp, id_):
                  """Handles PUT requests"""
                  admin_control(req)
          
                  if not id_.isdigit() or int(id_) <= 0:
          Severity: Minor
          Found in myems-api/core/user.py - About 1 hr to fix

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

                def on_put(req, resp, id_, pid):
                    """Handles PUT requests"""
                    admin_control(req)
                    if not id_.isdigit() or int(id_) <= 0:
                        raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
            Severity: Minor
            Found in myems-api/core/equipment.py - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (vf.v == 0 && i % 10 == 1 && i % 100 != 11) {    return PLURAL_CATEGORY.ONE;  }  if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14)) {    return PLURAL_CATEGORY.FEW;  }  if (vf.v == 0 && i % 10 == 0 || vf.v == 0 && i % 10 >= 5 && i % 10 <= 9 || vf.v == 0 && i % 100 >= 11 && i % 100 <= 14) {    return PLURAL_CATEGORY.MANY;  }  return PLURAL_CATEGORY.OTHER;}
              Severity: Critical
              Found in myems-admin/js/angular/i18n/angular-locale_uk.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                  "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (vf.v == 0 && i % 10 == 1 && i % 100 != 11) {    return PLURAL_CATEGORY.ONE;  }  if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14)) {    return PLURAL_CATEGORY.FEW;  }  if (vf.v == 0 && i % 10 == 0 || vf.v == 0 && i % 10 >= 5 && i % 10 <= 9 || vf.v == 0 && i % 100 >= 11 && i % 100 <= 14) {    return PLURAL_CATEGORY.MANY;  }  return PLURAL_CATEGORY.OTHER;}
                Severity: Critical
                Found in myems-admin/js/angular/i18n/angular-locale_ru-md.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                    "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (vf.v == 0 && i % 10 == 1 && i % 100 != 11) {    return PLURAL_CATEGORY.ONE;  }  if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14)) {    return PLURAL_CATEGORY.FEW;  }  if (vf.v == 0 && i % 10 == 0 || vf.v == 0 && i % 10 >= 5 && i % 10 <= 9 || vf.v == 0 && i % 100 >= 11 && i % 100 <= 14) {    return PLURAL_CATEGORY.MANY;  }  return PLURAL_CATEGORY.OTHER;}
                  Severity: Critical
                  Found in myems-admin/js/angular/i18n/angular-locale_ru-kg.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                      "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (vf.v == 0 && i % 10 == 1 && i % 100 != 11) {    return PLURAL_CATEGORY.ONE;  }  if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14)) {    return PLURAL_CATEGORY.FEW;  }  if (vf.v == 0 && i % 10 == 0 || vf.v == 0 && i % 10 >= 5 && i % 10 <= 9 || vf.v == 0 && i % 100 >= 11 && i % 100 <= 14) {    return PLURAL_CATEGORY.MANY;  }  return PLURAL_CATEGORY.OTHER;}
                    Severity: Critical
                    Found in myems-admin/js/angular/i18n/angular-locale_ru-ua.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                        "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (vf.v == 0 && i % 10 == 1 && i % 100 != 11) {    return PLURAL_CATEGORY.ONE;  }  if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14)) {    return PLURAL_CATEGORY.FEW;  }  if (vf.v == 0 && i % 10 == 0 || vf.v == 0 && i % 10 >= 5 && i % 10 <= 9 || vf.v == 0 && i % 100 >= 11 && i % 100 <= 14) {    return PLURAL_CATEGORY.MANY;  }  return PLURAL_CATEGORY.OTHER;}
                      Severity: Critical
                      Found in myems-admin/js/angular/i18n/angular-locale_ru-kz.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                          "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (vf.v == 0 && i % 10 == 1 && i % 100 != 11) {    return PLURAL_CATEGORY.ONE;  }  if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14)) {    return PLURAL_CATEGORY.FEW;  }  if (vf.v == 0 && i % 10 == 0 || vf.v == 0 && i % 10 >= 5 && i % 10 <= 9 || vf.v == 0 && i % 100 >= 11 && i % 100 <= 14) {    return PLURAL_CATEGORY.MANY;  }  return PLURAL_CATEGORY.OTHER;}
                        Severity: Critical
                        Found in myems-admin/js/angular/i18n/angular-locale_uk-ua.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                            "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (vf.v == 0 && i % 10 == 1 && i % 100 != 11) {    return PLURAL_CATEGORY.ONE;  }  if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14)) {    return PLURAL_CATEGORY.FEW;  }  if (vf.v == 0 && i % 10 == 0 || vf.v == 0 && i % 10 >= 5 && i % 10 <= 9 || vf.v == 0 && i % 100 >= 11 && i % 100 <= 14) {    return PLURAL_CATEGORY.MANY;  }  return PLURAL_CATEGORY.OTHER;}
                          Severity: Critical
                          Found in myems-admin/js/angular/i18n/angular-locale_ru.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                              "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (vf.v == 0 && i % 10 == 1 && i % 100 != 11) {    return PLURAL_CATEGORY.ONE;  }  if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14)) {    return PLURAL_CATEGORY.FEW;  }  if (vf.v == 0 && i % 10 == 0 || vf.v == 0 && i % 10 >= 5 && i % 10 <= 9 || vf.v == 0 && i % 100 >= 11 && i % 100 <= 14) {    return PLURAL_CATEGORY.MANY;  }  return PLURAL_CATEGORY.OTHER;}
                            Severity: Critical
                            Found in myems-admin/js/angular/i18n/angular-locale_ru-ru.js - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (vf.v == 0 && i % 10 == 1 && i % 100 != 11) {    return PLURAL_CATEGORY.ONE;  }  if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14)) {    return PLURAL_CATEGORY.FEW;  }  if (vf.v == 0 && i % 10 == 0 || vf.v == 0 && i % 10 >= 5 && i % 10 <= 9 || vf.v == 0 && i % 100 >= 11 && i % 100 <= 14) {    return PLURAL_CATEGORY.MANY;  }  return PLURAL_CATEGORY.OTHER;}
                              Severity: Critical
                              Found in myems-admin/js/angular/i18n/angular-locale_ru-by.js - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                            if (scope.ngFrom != null && scope.ngTo != null) {
                                                fromParsed = null;
                                                toParsed = null;
                                                slider.noUiSlider({
                                                    start: [
                                Severity: Critical
                                Found in myems-admin/js/plugins/nouslider/angular-nouislider.js - About 1 hr to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                              if (0 !== i.length) {
                                                  i.is("ul") || (0 === i.find("ul:first").length && i.append("<ul />"), i = i.find("ul")), i.find("li").remove();
                                                  var o = a.pageInfo;
                                                  o.control = i, o.pages.length > 0 && (i.append('<li class="footable-page-arrow"><a data-page="first" href="#first">' + a.pageInfo.firstText + "</a>"), i.append('<li class="footable-page-arrow"><a data-page="prev" href="#prev">' + a.pageInfo.previousText + "</a></li>"), o.limit && i.append('<li class="footable-page-arrow"><a data-page="limit-prev" href="#limit-prev">' + a.pageInfo.limitPreviousText + "</a></li>"), o.limit || e.each(o.pages, function(e, t) {
                                                      t.length > 0 && i.append('<li class="footable-page"><a data-page="' + e + '" href="#">' + (e + 1) + "</a></li>")
                                  Severity: Critical
                                  Found in myems-admin/js/plugins/footable/footable.all.min.js - About 1 hr to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                                    if (0 < a.currentList.length) {
                                                      v = k.$new();
                                                      v.data = Fb();
                                                      v.checkBoxStyle = a.options.checkBoxSettings.style;
                                                      !v.checkBoxStyle &&
                                    Severity: Critical
                                    Found in myems-admin/js/jcui/angular.integralui.treeview.min.js - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                                  if (a.options.enabled) {
                                                    (b = a.getTouchData(b)) &&
                                                      0 < b.length &&
                                                      (pa = { x: b[0].pageX, y: b[0].pageY });
                                                    var c = pa.x - Ya.x,
                                      Severity: Critical
                                      Found in myems-admin/js/jcui/angular.integralui.treeview.min.js - About 1 hr to fix

                                        Consider simplifying this complex logical expression.
                                        Open

                                                                    if (g) {
                                                                      c = n.getData();
                                                                      var t = c.source,
                                                                        p = a.isDropAllowed(t, g, c.dropPos);
                                                                      p &&
                                        Severity: Critical
                                        Found in myems-admin/js/jcui/angular.integralui.treeview.min.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language