asennikov/ember-g-map

View on GitHub
addon/components/g-map-marker.js

Summary

Maintainability
D
1 day
Test Coverage

GMapMarkerComponent has 29 functions (exceeds 20 allowed). Consider refactoring.
Open

const GMapMarkerComponent = Component.extend({
  layout,
  classNames: ['g-map-marker'],

  map: alias('mapContext.map'),
Severity: Minor
Found in addon/components/g-map-marker.js - About 3 hrs to fix

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

      setMap() {
        const map = this.get('map');
        const marker = this.get('marker');
    
        if (isPresent(marker) && isPresent(map)) {
    Severity: Major
    Found in addon/components/g-map-marker.js and 6 other locations - About 1 hr to fix
    addon/components/g-map-marker.js on lines 140..147
    addon/components/g-map-marker.js on lines 153..159
    addon/components/g-map-marker.js on lines 165..171
    addon/components/g-map-marker.js on lines 197..204
    addon/components/g-map-marker.js on lines 210..217
    addon/components/g-map-polyline.js on lines 74..81

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

      setTitle() {
        const marker = this.get('marker');
        const title = this.get('title');
    
        if (isPresent(marker) && isPresent(title)) {
    Severity: Major
    Found in addon/components/g-map-marker.js and 6 other locations - About 1 hr to fix
    addon/components/g-map-marker.js on lines 107..114
    addon/components/g-map-marker.js on lines 140..147
    addon/components/g-map-marker.js on lines 153..159
    addon/components/g-map-marker.js on lines 165..171
    addon/components/g-map-marker.js on lines 197..204
    addon/components/g-map-polyline.js on lines 74..81

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

      setDraggable() {
        const marker = this.get('marker');
        const draggable = this.get('draggable');
        if (isPresent(marker) && isPresent(draggable)) {
          marker.setDraggable(draggable);
    Severity: Major
    Found in addon/components/g-map-marker.js and 6 other locations - About 1 hr to fix
    addon/components/g-map-marker.js on lines 107..114
    addon/components/g-map-marker.js on lines 140..147
    addon/components/g-map-marker.js on lines 153..159
    addon/components/g-map-marker.js on lines 197..204
    addon/components/g-map-marker.js on lines 210..217
    addon/components/g-map-polyline.js on lines 74..81

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

      setLabel() {
        const marker = this.get('marker');
        const label = this.get('label');
    
        if (isPresent(marker) && isPresent(label)) {
    Severity: Major
    Found in addon/components/g-map-marker.js and 6 other locations - About 1 hr to fix
    addon/components/g-map-marker.js on lines 107..114
    addon/components/g-map-marker.js on lines 140..147
    addon/components/g-map-marker.js on lines 153..159
    addon/components/g-map-marker.js on lines 165..171
    addon/components/g-map-marker.js on lines 210..217
    addon/components/g-map-polyline.js on lines 74..81

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

      setIcon() {
        const marker = this.get('marker');
        const icon = this.get('icon');
    
        if (isPresent(marker) && isPresent(icon)) {
    Severity: Major
    Found in addon/components/g-map-marker.js and 6 other locations - About 1 hr to fix
    addon/components/g-map-marker.js on lines 107..114
    addon/components/g-map-marker.js on lines 153..159
    addon/components/g-map-marker.js on lines 165..171
    addon/components/g-map-marker.js on lines 197..204
    addon/components/g-map-marker.js on lines 210..217
    addon/components/g-map-polyline.js on lines 74..81

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

      setZIndex() {
        const marker = this.get('marker');
        const zIndex = this.get('zIndex');
        if (isPresent(marker) && isPresent(zIndex)) {
          marker.setZIndex(zIndex);
    Severity: Major
    Found in addon/components/g-map-marker.js and 6 other locations - About 1 hr to fix
    addon/components/g-map-marker.js on lines 107..114
    addon/components/g-map-marker.js on lines 140..147
    addon/components/g-map-marker.js on lines 165..171
    addon/components/g-map-marker.js on lines 197..204
    addon/components/g-map-marker.js on lines 210..217
    addon/components/g-map-polyline.js on lines 74..81

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

      unsetMarkerFromMap() {
        const marker = this.get('marker');
        if (isPresent(marker)) {
          marker.setMap(null);
        }
    Severity: Minor
    Found in addon/components/g-map-marker.js and 2 other locations - About 30 mins to fix
    addon/components/g-map-polyline.js on lines 63..68
    addon/components/g-map-route.js on lines 40..45

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

    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