Showing 10,536 of 10,536 total issues

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

  function getCursor(location) {
    switch (location) {
      default:
      case 1:
        return cursor > maxCursor - 3 && maxCursor - 3 >= 0 ? maxCursor - 3 : cursor;
Severity: Major
Found in myems-web/src/components/MyEMS/Meter/MeterRealtime.js and 1 other location - About 6 hrs to fix
myems-web/src/components/MyEMS/Space/SpaceEnvironmentMonitor.js on lines 212..224

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 171.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  function getCursor(location) {
    switch (location) {
      default:
      case 1:
        return cursor > maxCursor - 3 && maxCursor - 3 >= 0 ? maxCursor - 3 : cursor;
myems-web/src/components/MyEMS/Meter/MeterRealtime.js on lines 212..224

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 171.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  , showEditor: function() {
      var instance = this,
          textarea,
          ns = this.$ns,
          container = this.$element,
Severity: Major
Found in myems-admin/js/plugins/bootstrap-markdown/bootstrap-markdown.js - About 6 hrs to fix

    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

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

                            if (x1 <= x2 && x1 < axisx.min) {
                                if (x2 < axisx.min)
                                    continue;
                                y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
                                x1 = axisx.min;
        Severity: Major
        Found in myems-admin/js/plugins/flot/jquery.flot.js and 1 other location - About 6 hrs to fix
        myems-admin/js/plugins/flot/jquery.flot.js on lines 2270..2281

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 169.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

                    {isIterableArray(childSpaces) && (
                      <Col xs="auto" className="d-none d-sm-block">
                        <CustomInput
                          id="ddd"
                          type="select"
        Severity: Major
        Found in myems-web/src/components/MyEMS/common/ChartSpacesStackBar.js and 1 other location - About 6 hrs to fix
        myems-web/src/components/MyEMS/common/LineChart.js on lines 92..112

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 169.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

                            if (y1 >= y2 && y1 > axisy.max) {
                                if (y2 > axisy.max)
                                    continue;
                                x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
                                y1 = axisy.max;
        Severity: Major
        Found in myems-admin/js/plugins/flot/jquery.flot.js and 1 other location - About 6 hrs to fix
        myems-admin/js/plugins/flot/jquery.flot.js on lines 2284..2295

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 169.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

                  {isIterableArray(options) && (
                    <Col xs="auto" className="d-none d-sm-block">
                      <CustomInput
                        id="ddd"
                        type="select"
        Severity: Major
        Found in myems-web/src/components/MyEMS/common/LineChart.js and 1 other location - About 6 hrs to fix
        myems-web/src/components/MyEMS/common/ChartSpacesStackBar.js on lines 119..139

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 169.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

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

                  {isIterableArray(reports) ? (
                    <Row>
                      {reports.map(({ additional, ...rest }, index) => (
                        <Col md={6} className="h-100" key={index}>
                          <Summary divider={reports.length !== index + 1} {...rest}>
          myems-web/src/components/MyEMS/AdvancedReporting/AdvancedReporting.js on lines 233..247

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 168.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

                    {isIterableArray(reports) ? (
                      <Row>
                        {reports.map(({ additional, ...rest }, index) => (
                          <Col md={6} className="h-100" key={index}>
                            <Summary divider={reports.length !== index + 1} {...rest}>
          myems-web/src/components/MyEMS/KnowledgeBase/KnowledgeBase.js on lines 95..109

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 168.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

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

                  var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
                      for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
                      for (var r = Array(s), k = 0, i = 0; i < il; i++)
                          for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
                              r[k] = a[j];
              Severity: Major
              Found in myems-admin/js/ui-router/angular-ui-router.js and 1 other location - About 6 hrs to fix
              myems-admin/js/ui-router/angular-ui-router.js on lines 296..302

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 167.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                  $scope.getSpaceChildren = function (spaceid) {
                      let headers = { "User-UUID": $scope.cur_user.uuid, "Token": $scope.cur_user.token };
                      SpaceService.getSpaceChildren(spaceid, headers, function (response) {
                          if (angular.isDefined(response.status) && response.status === 200) {
                              $scope.currentSpace = response.data["current"];
              myems-admin/app/controllers/settings/menu/menu.controller.js on lines 88..99

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 167.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                                  if (x1 >= x2 && x1 > axisx.max) {
                                      if (x2 > axisx.max)
                                          continue;
                                      y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
                                      x1 = axisx.max;
              Severity: Major
              Found in myems-admin/js/plugins/flot/jquery.flot.js and 1 other location - About 6 hrs to fix
              myems-admin/js/plugins/flot/jquery.flot.js on lines 2298..2309

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 167.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                  $scope.getMenuChildren = function (menuid) {
                      let headers = { "User-UUID": $scope.cur_user.uuid, "Token": $scope.cur_user.token };
                      MenuService.getMenuChildren(menuid, headers, function (response) {
                          if (angular.isDefined(response.status) && response.status === 200) {
                              $scope.currentMenu = response.data["current"];
              Severity: Major
              Found in myems-admin/app/controllers/settings/menu/menu.controller.js and 1 other location - About 6 hrs to fix
              myems-admin/app/controllers/settings/space/space.controller.js on lines 116..127

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 167.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                                  if (x1 >= x2 && x1 > axisx.max) {
                                      if (x2 > axisx.max)
                                          continue;
                                      y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
                                      x1 = axisx.max;
              Severity: Major
              Found in myems-admin/js/plugins/flot/jquery.flot.js and 1 other location - About 6 hrs to fix
              myems-admin/js/plugins/flot/jquery.flot.js on lines 2381..2392

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 167.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                  var __spreadArrays$1 = (undefined && undefined.__spreadArrays) || function () {
                      for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
                      for (var r = Array(s), k = 0, i = 0; i < il; i++)
                          for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
                              r[k] = a[j];
              Severity: Major
              Found in myems-admin/js/ui-router/angular-ui-router.js and 1 other location - About 6 hrs to fix
              myems-admin/js/ui-router/angular-ui-router.js on lines 28..34

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 167.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language