groundtruth/PoziMobile

View on GitHub

Showing 38 of 38 total issues

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

            if (options.propogateGeometry) {
                return {
                    "geometry": {
                        "type": "Point",
                        "crs": { "type": "name", "properties": { "name": "EPSG:4326" } },
Severity: Major
Found in js/layers/RecordOnPointData.js and 1 other location - About 1 hr to fix
js/layers/PointData.js on lines 104..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 64.

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 setLocation has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    currentLocationLayer.setLocation = function(pointInWebMercator, accuracy) {

        var alreadyHadFeatures = this.features.length > 0;

        this.destroyFeatures();
Severity: Minor
Found in js/layers/currentLocation.js - About 1 hr to fix

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

        var PoziGeolocate = function(currentLocationLayer) {
    
            var watchId = undefined;
            var that = this;
    
    
    Severity: Minor
    Found in js/PoziGeolocate.js - About 1 hr to fix

      Function doSync has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              var doSync = function(item) {
                  that.updateInterface();
                  console.log('Synching ...');
                  if (item.data && item.data.properties)
                  {
      Severity: Minor
      Found in js/Syncher.js - About 1 hr to fix

        Function doNew has 10 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                    Function.prototype.doNew = function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) {
        Severity: Major
        Found in requirejsConfig.js - About 1 hr to fix

          Function defaultClick has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      defaultClick: function(evt) {
                          // For panning to work on desktop and mobile, the touch navigation controller must be added last.
                          // With the touch navigation controller last, feature selection by touch won't get to the SelectFeature controller without help.
                          // This assumes all features have geometries with an x and y (like a point).
                          if (evt.type === 'touchend' ) { // It's a mobile touch, so manually try feature selection.
          Severity: Minor
          Found in js/PoziMap.js - About 1 hr to fix

            Function update has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    this.update = function(feature) {
                        that.initForm(feature);
                        that.initButtons({
                            delete: function() {
                                if (confirm("Are you sure you want to delete this record?")) {
            Severity: Minor
            Found in js/pages/Details.js - About 1 hr to fix

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

                              var restful_geof_endpoint = options.displayEndpoint+filter+'/closest/'+pointInWGS84.lon+'/'+pointInWGS84.lat+'/limit/'+options.featuresLimit;
              Severity: Major
              Found in js/layers/RecordOnPointData.js and 1 other location - About 1 hr to fix
              js/layers/PointData.js on lines 70..70

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

              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

                              var restful_geof_endpoint = options.displayEndpoint+filter+'/closest/'+pointInWGS84.lon+'/'+pointInWGS84.lat+'/limit/'+options.featuresLimit;
              Severity: Major
              Found in js/layers/PointData.js and 1 other location - About 1 hr to fix
              js/layers/RecordOnPointData.js on lines 91..91

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

              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

                          default:
                              this.layer = OpenLayers.Layer.Bing.doNew({
                                  key: bingApiKey, // note: a trial key will generate erorrs "Uncaught TypeError: Cannot read property 'resources' of undefined"
                                  type: "Road",
                                  name: "Bing Road",
              Severity: Minor
              Found in js/layers/Bing.js and 1 other location - About 50 mins to fix
              js/layers/Bing.js on lines 7..14

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

              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

                          case "AerialWithLabels":
                              this.layer = OpenLayers.Layer.Bing.doNew({
                                  key: bingApiKey, // note: a trial key will generate erorrs "Uncaught TypeError: Cannot read property 'resources' of undefined"
                                  type: "AerialWithLabels",
                                  name: "Bing Aerial + Labels",
              Severity: Minor
              Found in js/layers/Bing.js and 1 other location - About 50 mins to fix
              js/layers/Bing.js on lines 16..23

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

              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

                      var style = OpenLayers.Style.doNew({
                          externalGraphic: options.iconFile,
                          graphicOpacity: 1.0,
                          graphicWith: 16,
                          graphicHeight: 26,
              Severity: Minor
              Found in js/layers/RecordOnPointData.js and 1 other location - About 50 mins to fix
              js/layers/PointData.js on lines 16..22

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

              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

                      var style = OpenLayers.Style.doNew({
                          externalGraphic: options.iconFile,
                          graphicOpacity: 1.0,
                          graphicWith: 16,
                          graphicHeight: 26,
              Severity: Minor
              Found in js/layers/PointData.js and 1 other location - About 50 mins to fix
              js/layers/RecordOnPointData.js on lines 16..22

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

              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

              Avoid deeply nested control flow statements.
              Open

                      if (!_(layerConfig.options).has('bingApiKey')) { throw Error('Bing API key requried!') }
              Severity: Major
              Found in js/Layers.js - About 45 mins to fix

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

                                        syncher.persist({
                                            restEndpoint: layerOptions.restEndpoint,
                                            action: "delete",
                                            data: updatedGeoFeature(),
                                            id: combinedHash()[layerOptions.idField]
                Severity: Minor
                Found in js/pages/Details.js and 1 other location - About 45 mins to fix
                js/pages/Details.js on lines 168..173

                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

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

                                    syncher.persist({
                                        restEndpoint: layerOptions.restEndpoint,
                                        action: "update",
                                        data: updatedGeoFeature(),
                                        id: combinedHash()[layerOptions.idField]
                Severity: Minor
                Found in js/pages/Details.js and 1 other location - About 45 mins to fix
                js/pages/Details.js on lines 157..162

                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

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

                            $page.find('footer').children().first().children().append('<button id="infoButton" data-transition="none" data-icon="info" data-iconpos="notext" data-rel="popup">Info</button>').trigger("create");
                Severity: Minor
                Found in js/pages/Main.js and 1 other location - About 40 mins to fix
                js/pages/Main.js on lines 94..94

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

                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

                            $page.find('footer').children().last().children().append('<button id="searchButton" data-transition="none" data-icon="search" data-iconpos="notext" data-rel="popup">Search</button>').trigger("create");
                Severity: Minor
                Found in js/pages/Main.js and 1 other location - About 40 mins to fix
                js/pages/Main.js on lines 89..89

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

                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