asennikov/ember-g-map

View on GitHub

Showing 6 of 35 total issues

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

    Function exports has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function() {
      return Promise.all([
        getChannelURL('release'),
        getChannelURL('beta'),
        getChannelURL('canary')
    Severity: Major
    Found in config/ember-try.js - About 3 hrs to fix

      Function contentFor has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

        contentFor(type, config) {
          let content = '';
      
          if (type === 'head') {
            let src = '//maps.googleapis.com/maps/api/js';
      Severity: Minor
      Found in index.js - About 2 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 contentFor has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        contentFor(type, config) {
          let content = '';
      
          if (type === 'head') {
            let src = '//maps.googleapis.com/maps/api/js';
      Severity: Minor
      Found in index.js - About 1 hr to fix

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

          updateRoute() {
            const service = this.get('directionsService');
            const renderer = this.get('directionsRenderer');
            const originLat = this.get('originLat');
            const originLng = this.get('originLng');
        Severity: Minor
        Found in addon/components/g-map-route.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

              if (isPresent(service) && isPresent(renderer)
                && isPresent(originLat) && isPresent(originLng)
                && isPresent(destinationLat) && isPresent(destinationLng)
                && (typeof FastBoot === 'undefined')) {
                const origin = new google.maps.LatLng(this.get('originLat'), this.get('originLng'));
          Severity: Major
          Found in addon/components/g-map-route.js - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language