YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js

Summary

Maintainability
F
2 wks
Test Coverage

File Map.js has 839 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */
'use strict';

jQuery.Class(
    'OpenStreetMap_Map_Js',
Severity: Major
Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 2 days to fix

    Function registerBasicModal has 305 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            registerBasicModal: function () {
                var thisInstance = this;
                var container = this.container;
                var map = thisInstance.mapInstance;
                var layer, description;
    Severity: Major
    Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 1 day to fix

      Function setMarkers has 108 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              setMarkers: function (data) {
                  var thisInstance = this;
                  var markerArray = [];
                  var container = this.container;
                  var map = this.mapInstance;
      Severity: Major
      Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 4 hrs to fix

        Function registerSearchAddress has 90 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                registerSearchAddress: function () {
                    const searchValue = this.container.find('.js-search-address'),
                        searchBtn = this.container.find('.js-search-btn'),
                        operator = this.container.find('.js-select-operator');
                    if (operator.length && operator.val()) {
        Severity: Major
        Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 3 hrs to fix

          Function registerSearchCompany has 86 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  registerSearchCompany: function () {
                      const searchValue = this.container.find('.js-search-company');
                      const searchModule = this.container.find('.searchModule');
                      $.widget('custom.ivAutocomplete', $.ui.autocomplete, {
                          _create: function () {
          Severity: Major
          Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 3 hrs to fix

            Function registerCacheEvents has 78 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    registerCacheEvents: function (container) {
                        var thisInstance = this;
                        container.find('.showRecordsFromCache').on('change', (e) => {
                            const currentTarget = $(e.currentTarget),
                                moduleName = currentTarget.data('module');
            Severity: Major
            Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 3 hrs to fix

              Function setMarkers has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                      setMarkers: function (data) {
                          var thisInstance = this;
                          var markerArray = [];
                          var container = this.container;
                          var map = this.mapInstance;
              Severity: Minor
              Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 1 hr 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 registerDetailView has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      registerDetailView: function (container) {
                          this.container = container;
                          var coordinates = container.find('#coordinates').val();
                          coordinates = JSON.parse(coordinates);
                          var startCoordinate = [0, 0];
              Severity: Minor
              Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 1 hr to fix

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

                        registerMyLocation: function () {
                            const locationBtn = this.container.find('.js-my-location-btn');
                            if (!navigator.geolocation) {
                                locationBtn.addClass('d-none');
                                return;
                Severity: Minor
                Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 1 hr to fix

                  Function source has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                          source: function (request, response) {
                                              AppConnector.request({
                                                  module: app.getModuleName(),
                                                  action: 'Fields',
                                                  mode: 'findAddress',
                  Severity: Minor
                  Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 1 hr to fix

                    Function select has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                    select: (_event, ui) => {
                                        this.recordsIds.push(ui.item.id);
                                        AppConnector.request({
                                            module: 'OpenStreetMap',
                                            action: 'ClipBoard',
                    Severity: Minor
                    Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 1 hr to fix

                      Function registerDetailView has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                              registerDetailView: function (container) {
                                  this.container = container;
                                  var coordinates = container.find('#coordinates').val();
                                  coordinates = JSON.parse(coordinates);
                                  var startCoordinate = [0, 0];
                      Severity: Minor
                      Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 55 mins 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 registerSearchAddress has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                              registerSearchAddress: function () {
                                  const searchValue = this.container.find('.js-search-address'),
                                      searchBtn = this.container.find('.js-search-btn'),
                                      operator = this.container.find('.js-select-operator');
                                  if (operator.length && operator.val()) {
                      Severity: Minor
                      Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 25 mins 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

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

                                  container.on('click', '.endTrack', function (e) {
                                      if (endIconLayer) {
                                          map.removeLayer(endIconLayer);
                                      }
                                      var currentTarget = $(e.currentTarget);
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 558..581

                      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 308.

                      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

                                  container.on('click', '.startTrack', function (e) {
                                      if (startIconLayer) {
                                          map.removeLayer(startIconLayer);
                                      }
                                      var currentTarget = $(e.currentTarget);
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 583..606

                      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 308.

                      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

                                              thisInstance.cacheMarkers[key].forEach(function (e) {
                                                  var marker = L.marker([e.lat, e.lon], {
                                                      icon: L.AwesomeMarkers.icon({
                                                          icon: 'home',
                                                          markerColor: 'orange',
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 508..518

                      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 118.

                      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

                                              thisInstance.cacheMarkers[key].forEach(function (e) {
                                                  var marker = L.marker([e.lat, e.lon], {
                                                      icon: L.AwesomeMarkers.icon({
                                                          icon: 'home',
                                                          markerColor: 'orange',
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 539..549

                      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 118.

                      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

                                                  AppConnector.request({
                                                      module: app.getModuleName(),
                                                      action: 'Fields',
                                                      mode: 'findAddress',
                                                      type: operator.val(),
                      public_html/layouts/basic/modules/Vtiger/resources/Edit.js on lines 1151..1169

                      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 112.

                      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 3 locations. Consider refactoring.
                      Open

                                          markers.forEach(function (e) {
                                              var marker = L.marker([e.lat, e.lon], {
                                                  icon: L.AwesomeMarkers.icon({
                                                      icon: 'home',
                                                      markerColor: 'blue',
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 524..534
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 831..841

                      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 110.

                      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 3 locations. Consider refactoring.
                      Open

                                          markers.forEach(function (e) {
                                              var marker = L.marker([e.lat, e.lon], {
                                                  icon: L.AwesomeMarkers.icon({
                                                      icon: 'home',
                                                      markerColor: 'blue',
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 491..501
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 831..841

                      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 110.

                      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 3 locations. Consider refactoring.
                      Open

                                  coordinates.forEach(function (e) {
                                      var marker = L.marker([e.lat, e.lon], {
                                          icon: L.AwesomeMarkers.icon({
                                              icon: 'home',
                                              markerColor: 'blue',
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 491..501
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 524..534

                      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 110.

                      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

                                  } else {
                                      if ($('.bodyContents').height() < 1000) {
                                          $map.height(
                                              $('.bodyContents').height() -
                                                  ($('.detailViewTitle').height() + $('.detailViewContainer .related').height() + 25)
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 807..816

                      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 96.

                      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 ($('.mainBody').length) {
                                      if ($('.mainBody').height() < 1000) {
                                          $map.height(
                                              $('.mainBody').height() -
                                                  ($('.detailViewTitle').height() + $('.detailViewContainer .related').height() + 25)
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 816..825

                      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 96.

                      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

                                  container.on('click', '.moveDown', function (e) {
                                      var currentTarget = $(e.currentTarget);
                                      var container = currentTarget.closest('.indirectContainer');
                                      var nextElement = container.next();
                                      if (!nextElement.hasClass('indirectTemplate')) {
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 642..649

                      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 91.

                      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

                                  container.on('click', '.moveUp', function (e) {
                                      var currentTarget = $(e.currentTarget);
                                      var container = currentTarget.closest('.indirectContainer');
                                      var previousElement = container.prev();
                                      if (!previousElement.hasClass('startContainer')) {
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 650..657

                      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 91.

                      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

                                          let marker = L.marker([position.coords.latitude, position.coords.longitude], {
                                              icon: L.AwesomeMarkers.icon({
                                                  icon: 'home',
                                                  markerColor: 'cadetblue',
                                                  prefix: 'fa'
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 74..80

                      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 68.

                      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

                                          let marker = L.marker([data.coordinatesCenter.lat, data.coordinatesCenter.lon], {
                                              icon: L.AwesomeMarkers.icon({
                                                  icon: 'search',
                                                  markerColor: 'red',
                                                  prefix: 'fa'
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 436..447

                      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 68.

                      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

                                      _renderItem: function (ul, item) {
                                          return $('<li>').data('item.autocomplete', item).append($('<a></a>').html(item.label)).appendTo(ul);
                                      }
                      public_html/layouts/basic/modules/Calendar/resources/Edit.js on lines 521..523

                      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 60.

                      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 3 locations. Consider refactoring.
                      Open

                                      AppConnector.request(params).done(function (response) {
                                          progressIndicatorElement.progressIndicator({ mode: 'hide' });
                                          thisInstance.setMarkers(response.result);
                                      });
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 478..481
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 783..786

                      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 57.

                      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 3 locations. Consider refactoring.
                      Open

                                      AppConnector.request(params).done(function (response) {
                                          progressIndicatorElement.progressIndicator({ mode: 'hide' });
                                          thisInstance.setMarkers(response.result);
                                      });
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 681..684
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 783..786

                      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 57.

                      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 3 locations. Consider refactoring.
                      Open

                                  AppConnector.request(params).done(function (response) {
                                      progressIndicatorElement.progressIndicator({ mode: 'hide' });
                                      thisInstance.setMarkers(response.result);
                                  });
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 478..481
                      public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js on lines 681..684

                      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 57.

                      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

                                  const searchValue = this.container.find('.js-search-address'),
                                      searchBtn = this.container.find('.js-search-btn'),
                                      operator = this.container.find('.js-select-operator');
                      public_html/layouts/basic/modules/Documents/resources/MassAddDocuments.js on lines 19..21

                      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 53.

                      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

                                      searchValue
                                          .autocomplete({
                                              delay: 600,
                                              minLength: 3,
                                              source: function (request, response) {
                      public_html/layouts/basic/modules/Vtiger/resources/Edit.js on lines 1148..1226

                      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 53.

                      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 (responseDataList.length <= 0) {
                                                  responseDataList.push({
                                                      label: app.vtranslate('JS_NO_RESULTS_FOUND'),
                                                      type: 'no results',
                                                      category: ''
                      public_html/layouts/basic/modules/Calendar/resources/Edit.js on lines 536..542

                      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 50.

                      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

                      There are no issues that match your filters.

                      Category
                      Status