Showing 5,781 of 10,536 total issues

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

const FavouriteItems = () => {
  const { favouriteItems } = useContext(ProductContext);

  return (
    <Card>
Severity: Minor
Found in myems-web/src/components/e-commerce/FavouriteItems.js - About 1 hr to fix

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

    const ShoppingCartTable = () => {
      const { currency } = useContext(AppContext);
      const { products, shoppingCart, appliedPromo } = useContext(ProductContext);
    
      return (

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

      const WidgetsBilling = () => {
        const [plan, setPlan] = useState('monthly');
      
        return (
          <Card className="h-100">
      Severity: Minor
      Found in myems-web/src/components/widgets/WidgetsBilling.js - About 1 hr to fix

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

          let onSpaceCascaderChange = (value, selectedOptions) => {
            setSelectedSpaceName(selectedOptions.map(o => o.label).join('/'));
            setSelectedSpaceID(value[value.length - 1]);
        
            let isResponseOK = false;

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

              def on_get(req, resp):
                  if 'API-KEY' not in req.headers or \
                          not isinstance(req.headers['API-KEY'], str) or \
                          len(str.strip(req.headers['API-KEY'])) == 0:
                      access_control(req)
          Severity: Minor
          Found in myems-api/reports/metertracking.py - About 1 hr to fix

            Function createSvgTag has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _this.createSvgTag = function(cellSize, margin, alt, title) {
            
                  var opts = {};
                  if (typeof arguments[0] == 'object') {
                    // Called by options.
            Severity: Minor
            Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

              Function resolveElementClasses has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function resolveElementClasses(existing, toAdd, toRemove) {
                var ADD_CLASS = 1;
                var REMOVE_CLASS = -1;
              
                var flags = {};
              Severity: Minor
              Found in myems-admin/js/angular/angular-animate.js - About 1 hr to fix

                Function qrPolynomial has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function qrPolynomial(num, shift) {
                
                    if (typeof num.length == 'undefined') {
                      throw num.length + '/' + shift;
                    }
                Severity: Minor
                Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                  Function dump has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  angular.mock.dump = function(object) {
                    return serialize(object);
                  
                    function serialize(object) {
                      var out;
                  Severity: Minor
                  Found in myems-admin/js/angular/angular-mocks.js - About 1 hr to fix

                    Function inject has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                    inject: function inject(moduleName) {
                                        var localParams = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
                                        var real = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
                    
                                        var self = this,
                    Severity: Minor
                    Found in myems-admin/js/plugins/oclazyload/ocLazyLoad.js - About 1 hr to fix

                      Function link has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  link: function (scope, element, attrs) {
                                      var dateChange = null,
                                          pickerRangeID = element[0].id,
                                          pickerIDs = [randomName(), randomName()],
                                          createMoment = datePickerUtils.createMoment,
                      Severity: Minor
                      Found in myems-admin/js/plugins/datapicker/angular-datepicker.js - About 1 hr to fix

                        Function drawSeriesPoints has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function drawSeriesPoints(series) {
                                    function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) {
                                        var points = datapoints.points, ps = datapoints.pointsize;
                        
                                        for (var i = 0; i < points.length; i += ps) {
                        Severity: Minor
                        Found in myems-admin/js/plugins/flot/jquery.flot.js - About 1 hr to fix

                          Function Paginations has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const Paginations = () => {
                            return (
                              <Fragment>
                                <PageHeader
                                  title="Pagination"
                          Severity: Minor
                          Found in myems-web/src/components/bootstrap-components/Paginations.js - About 1 hr to fix

                            Function handleSubmit has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              const handleSubmit = e => {
                                e.preventDefault();
                                let isResponseOK = false;
                                if (captchaCode.toLowerCase() !== code.toLowerCase()) {
                                  toast.error(t('Captcha Error'));
                            Severity: Minor
                            Found in myems-web/src/components/MyEMS/auth/LoginForm.js - About 1 hr to fix

                              Function on_get has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def on_get(req, resp):
                                      if 'API-KEY' not in req.headers or \
                                              not isinstance(req.headers['API-KEY'], str) or \
                                              len(str.strip(req.headers['API-KEY'])) == 0:
                                          access_control(req)
                              Severity: Minor
                              Found in myems-api/reports/enterproduction.py - About 1 hr to fix

                                Function generate_excel has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                def generate_excel(report, name, reporting_start_datetime_local, reporting_end_datetime_local,
                                                   base_period_start_datetime, base_period_end_datetime, period_type, language):
                                    trans = get_translation(language)
                                    trans.install()
                                    _ = trans.gettext
                                Severity: Minor
                                Found in myems-api/excelexporters/meterenergy.py - About 1 hr to fix

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

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

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

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

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

                                          var RegisteredHook = /** @class */ (function () {
                                              function RegisteredHook(tranSvc, eventType, callback, matchCriteria, removeHookFromRegistry, options) {
                                                  if (options === void 0) { options = {}; }
                                                  this.tranSvc = tranSvc;
                                                  this.eventType = eventType;
                                      Severity: Minor
                                      Found in myems-admin/js/ui-router/angular-ui-router.js - About 1 hr to fix

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

                                          var base64DecodeInputStream = function(str) {
                                        
                                            var _str = str;
                                            var _pos = 0;
                                            var _buffer = 0;
                                        Severity: Minor
                                        Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language