Showing 5,781 of 10,536 total issues

Function Header has 168 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Header(calendar, options) {
    var t = this;
    
    // exports
    t.render = render;
Severity: Major
Found in myems-admin/js/plugins/fullcalendar/fullcalendar.js - About 6 hrs to fix

    Function SpinnersExample has 168 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const SpinnersExample = () => {
      const { setNavbarStyle } = useContext(AppContext);
      return (
        <Fragment>
          <PageHeader
    Severity: Major
    Found in myems-web/src/components/bootstrap-components/VerticalNavbar.js - About 6 hrs to fix

      Function processData has 167 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function processData() {
                  var topSentry = Number.POSITIVE_INFINITY,
                      bottomSentry = Number.NEGATIVE_INFINITY,
                      fakeInfinity = Number.MAX_VALUE,
                      i, j, k, m, length,
      Severity: Major
      Found in myems-admin/js/plugins/flot/jquery.flot.js - About 6 hrs to fix

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

              link: function(scope, element, attrs) {
                var domElement = element[0],
                    $canvas = element.find('canvas'),
                    canvas = $canvas[0],
                    context = canvas2D ? canvas.getContext('2d') : null,
        Severity: Major
        Found in myems-admin/js/angular/angular-qrcode.js - About 6 hrs to fix

          File moment-timezone.js has 443 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          //! moment-timezone.js
          //! version : 0.5.0
          //! author : Tim Wood
          //! license : MIT
          //! github.com/moment/moment-timezone
          Severity: Minor
          Found in myems-admin/js/plugins/moment/moment-timezone.js - About 6 hrs to fix

            Function init has 164 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function init(plot) {
                    plot.hooks.processOptions.push(function (plot, options) {
                        $.each(plot.getAxes(), function(axisName, axis) {
            
                            var opts = axis.options;
            Severity: Major
            Found in myems-admin/js/plugins/flot/jquery.flot.time.js - About 6 hrs to fix

              Function renderCalendar has 164 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      renderCalendar: function (calendar, selected, minDate, maxDate, side) {
              
                          var html = '<div class="calendar-date">';
                          html += '<table class="table-condensed">';
                          html += '<thead>';
              Severity: Major
              Found in myems-admin/js/plugins/daterangepicker/daterangepicker.js - About 6 hrs to fix

                Function on_get has 164 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: Major
                Found in myems-api/reports/energystoragepowerstationdetails.py - About 6 hrs to fix

                  File highcharts-ng.js has 439 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.exports === exports){
                    module.exports = 'highcharts-ng';
                  }
                  
                  (function () {
                  Severity: Minor
                  Found in myems-admin/js/angular-highcharts/highcharts-ng.js - About 6 hrs to fix

                    Function init has 162 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        value: function init() {
                          var _this3 = this;
                    
                          // In case it isn't set already
                          if (this.element.tagName === "form") {
                    Severity: Major
                    Found in myems-admin/js/plugins/dropzone/dropzone.js - About 6 hrs to fix

                      File angular-route.js has 435 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /**
                       * @license AngularJS v1.8.3
                       * (c) 2010-2020 Google LLC. http://angularjs.org
                       * License: MIT
                       */
                      Severity: Minor
                      Found in myems-admin/js/angular/angular-route.js - About 6 hrs to fix

                        Function ProductAdd has 161 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const ProductAdd = () => {
                          const { products, productsDispatch } = useContext(ProductContext);
                          const [title, setTitle] = useState('');
                          const [category, setCategory] = useState('Camera');
                          const [files, setFiles] = useState([]);
                        Severity: Major
                        Found in myems-web/src/components/e-commerce/ProductAdd.js - About 6 hrs to fix

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

                              def on_get(req, resp):
                                  # todo: change this procedure from space to store
                                  if 'API-KEY' not in req.headers or \
                                          not isinstance(req.headers['API-KEY'], str) or \
                                          len(str.strip(req.headers['API-KEY'])) == 0:
                          Severity: Major
                          Found in myems-api/reports/storedashboard.py - About 6 hrs to fix

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

                                def on_get(req, resp):
                                    # todo: change this procedure from space to shopfloor
                                    if 'API-KEY' not in req.headers or \
                                            not isinstance(req.headers['API-KEY'], str) or \
                                            len(str.strip(req.headers['API-KEY'])) == 0:
                            Severity: Major
                            Found in myems-api/reports/shopfloordashboard.py - About 6 hrs to fix

                              Function on_get has 161 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: Major
                              Found in myems-api/reports/dashboard.py - About 6 hrs to fix

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

                                    def on_get(req, resp):
                                        # todo: change this procedure from space to tenant
                                        if 'API-KEY' not in req.headers or \
                                                not isinstance(req.headers['API-KEY'], str) or \
                                                len(str.strip(req.headers['API-KEY'])) == 0:
                                Severity: Major
                                Found in myems-api/reports/tenantdashboard.py - About 6 hrs to fix

                                  Function MicrogridListItem has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const MicrogridListItem = ({
                                    id,
                                    uuid,
                                    files,
                                    name,
                                  Severity: Minor
                                  Found in myems-web/src/components/MyEMS/Microgrid/MicrogridListItem.js - About 6 hrs 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 on_get has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def on_get(req, resp):
                                          """Handles GET requests"""
                                          access_control(req)
                                          # Verify User Session
                                          token = req.headers.get('TOKEN')
                                  Severity: Minor
                                  Found in myems-api/core/webmessage.py - About 6 hrs 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 on_get has 160 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: Major
                                  Found in myems-api/reports/spaceproduction.py - About 6 hrs to fix

                                    File wechatmessage.py has 431 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import re
                                    from datetime import datetime, timedelta, timezone
                                    import falcon
                                    import mysql.connector
                                    import simplejson as json
                                    Severity: Minor
                                    Found in myems-api/core/wechatmessage.py - About 6 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language