konsultaner/jsonOdm

View on GitHub

Showing 272 of 272 total issues

File geo.js has 976 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use strict";

// for code climate recognition
if (typeof jsonOdm === "undefined") {
    var jsonOdm;
Severity: Major
Found in src/geo.js - About 2 days to fix

    Function decorate has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
    Open

    jsonOdm.Collection.decorate = function (collection) {
        var decorate = function (collection) {
            if (jsonOdm.util.isArray(collection)) {
                /**
                 * // TODO needs a proper has many functionality that aromatically gathers the child elements
    Severity: Minor
    Found in src/collection.js - About 2 days 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 within has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
    Open

    jsonOdm.Geo.MultiPoint.within = function (multiPoint, geometry) {
        var i, j, k, found;
        if (!multiPoint.coordinates || !jsonOdm.util.isArray(multiPoint.coordinates)) {
            return false;
        }
    Severity: Minor
    Found in src/geo.js - About 1 day 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

    File query.js has 593 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    "use strict";
    
    // for code climate recognition
    if (typeof jsonOdm === "undefined") {
        var jsonOdm;
    Severity: Major
    Found in src/query.js - About 1 day to fix

      Function intersects has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
      Open

      jsonOdm.Geo.MultiPoint.intersects = function (multiPoint, geometry) {
          var i, j, k;
          if (!multiPoint.coordinates || !jsonOdm.util.isArray(multiPoint.coordinates)) {
              return false;
          }
      Severity: Minor
      Found in src/geo.js - About 1 day 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 within has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
      Open

      jsonOdm.Geo.MultiLineString.within = function (multiLineString, geometry) {
          var i, j, k, found;
          if (!multiLineString.coordinates || !jsonOdm.util.isArray(multiLineString.coordinates)) {
              return false;
          }
      Severity: Minor
      Found in src/geo.js - About 1 day 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 intersects has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
      Open

      jsonOdm.Geo.MultiLineString.intersects = function (multiLineString, geometry) {
          var i, j, k;
          if (!multiLineString.coordinates || !jsonOdm.util.isArray(multiLineString.coordinates)) {
              return false;
          }
      Severity: Minor
      Found in src/geo.js - About 1 day 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 within has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
      Open

      jsonOdm.Geo.MultiPolygon.within = function (multiPolygon, geometry) {
          var i, j, k, found;
          if (!multiPolygon.coordinates || !jsonOdm.util.isArray(multiPolygon.coordinates)) {
              return false;
          }
      Severity: Minor
      Found in src/geo.js - About 7 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function intersects has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
      Open

      jsonOdm.Geo.LineString.intersects = function (lineString, geometry) {
          var i, j;
          if (!lineString.coordinates || !jsonOdm.util.isArray(lineString.coordinates)) {
              return false;
          }
      Severity: Minor
      Found in src/geo.js - About 7 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function within has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

      jsonOdm.Geo.Point.within = function (point, geometry) {
          var i, j;
          if (!point.coordinates) {
              return false;
          }
      Severity: Minor
      Found in src/geo.js - About 6 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

          if (geometry.type === "MultiLineString") {
              for (k = 0; multiPoint.coordinates && k < multiPoint.coordinates.length; k++) {
                  found = false;
                  for (i = 0; geometry.coordinates && i < geometry.coordinates.length; i++) {
                      if (jsonOdm.Geo.pointWithinLineString(multiPoint.coordinates[k], geometry.coordinates[i])) {
      Severity: Major
      Found in src/geo.js and 1 other location - About 6 hrs to fix
      src/geo.js on lines 598..612

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

      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 (geometry.type === "MultiLineString") {
              for (j = 0; multiLineString.coordinates && j < multiLineString.coordinates.length; j++) {
                  found = false;
                  for (i = 0; geometry.coordinates && i < geometry.coordinates.length; i++) {
                      if (jsonOdm.Geo.lineStringWithinLineString(multiLineString.coordinates[j], geometry.coordinates[i])) {
      Severity: Major
      Found in src/geo.js and 1 other location - About 6 hrs to fix
      src/geo.js on lines 267..281

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

      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 within has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

      jsonOdm.Geo.LineString.within = function (lineString, geometry) {
          var i, j;
          if (!lineString.coordinates || !jsonOdm.util.isArray(lineString.coordinates)) {
              return false;
          }
      Severity: Minor
      Found in src/geo.js - About 5 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

                  (point[1] >= lineString[i][1] && point[1] <= lineString[i + 1][1] && lineString[i][1] <= lineString[i + 1][1]) ||
                  (point[1] <= lineString[i][1] && point[1] >= lineString[i + 1][1] && lineString[i][1] >= lineString[i + 1][1])
      Severity: Major
      Found in src/geo.js and 1 other location - About 5 hrs to fix
      src/geo.js on lines 1249..1250

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

      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

                  (point[0] >= lineString[i][0] && point[0] <= lineString[i + 1][0] && lineString[i][0] <= lineString[i + 1][0]) ||
                  (point[0] <= lineString[i][0] && point[0] >= lineString[i + 1][0] && lineString[i][0] >= lineString[i + 1][0])
      Severity: Major
      Found in src/geo.js and 1 other location - About 5 hrs to fix
      src/geo.js on lines 1253..1254

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

      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 intersects has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

      jsonOdm.Geo.MultiPolygon.intersects = function (multiPolygon, geometry) {
          var i, j, k;
          if (!multiPolygon.coordinates || !jsonOdm.util.isArray(multiPolygon.coordinates)) {
              return false;
          }
      Severity: Minor
      Found in src/geo.js - About 5 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

                      (lineString[i][0] === point[0] && lineString[i][1] === point[1]) ||
                      (lineString[i + 1][0] === point[0] && lineString[i + 1][1] === point[1]) ||
      
                      ((lineString[i][1] - lineString[i + 1][1]) != 0 && ((lineString[i][0] - lineString[i + 1][0]) * ((point[1] - lineString[i + 1][1]) / (lineString[i][1] - lineString[i + 1][1])) + lineString[i + 1][0] === point[0])) ||
      Severity: Major
      Found in src/geo.js and 1 other location - About 4 hrs to fix
      src/geo.js on lines 1259..1263

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

      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 within has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

      jsonOdm.Geo.Polygon.within = function (polygon, geometry) {
          var i, j;
          if (!polygon.coordinates || !jsonOdm.util.isArray(polygon.coordinates)) {
              return false;
          }
      Severity: Minor
      Found in src/geo.js - About 4 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function intersects has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

      jsonOdm.Geo.Polygon.intersects = function (polygon, geometry) {
          var i, j;
          if (!polygon.coordinates || !jsonOdm.util.isArray(polygon.coordinates)) {
              return false;
          }
      Severity: Minor
      Found in src/geo.js - About 4 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

      jsonOdm.Query.prototype.$subtract = function (branch) {
          if( typeof branch === "undefined" ) {
              return this;
          }
          return this.$queryOperator(arguments, function (queryResults) {
      Severity: Major
      Found in src/query.js and 2 other locations - About 4 hrs to fix
      src/query.js on lines 668..679
      src/query.js on lines 696..707

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

      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