map/client/mixins/globe/mixin.base-globe.js

Summary

Maintainability
D
2 days
Test Coverage

Showing 15 of 15 total issues

baseGlobe has 54 functions (exceeds 20 allowed). Consider refactoring.
Open

methods: {
refreshGlobe () {
},
setupGlobe (domEl, token, options = {}) {
this.viewerOptions = _.defaults(options, _.get(this, 'activityOptions.engine.viewer', {}), {
Severity: Major
Found in map/client/mixins/globe/mixin.base-globe.js - About 7 hrs to fix

    File mixin.base-globe.js has 646 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    import _ from 'lodash'
    import sift from 'sift'
    import logger from 'loglevel'
    import Emitter from 'tiny-emitter'
    import { getCssVar } from 'quasar'
    Severity: Major
    Found in map/client/mixins/globe/mixin.base-globe.js - About 5 hrs to fix

      Function getDefaultPickHandler has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring.
      Open

      async getDefaultPickHandler (event) {
      const emittedEvent = {}
      let options
      let pickedPosition = this.viewer.camera.pickEllipsoid(event.endPosition || event.position, this.viewer.scene.globe.ellipsoid)
      if (pickedPosition) {
      Severity: Minor
      Found in map/client/mixins/globe/mixin.base-globe.js - About 2 hrs to fix

      Function center has 61 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      center (longitude, latitude, altitude, heading = 0, pitch = -90, roll = 0, options = {}) {
      const center = this.viewer.camera.positionCartographic
      const duration = _.get(options, 'duration', 0)
      // This is the "base" frame, position with orientation in east north up frame at position
      const destination = Cartesian3.fromDegrees(longitude, latitude, altitude || center.height)
      Severity: Major
      Found in map/client/mixins/globe/mixin.base-globe.js - About 1 hr to fix

        Function setupGlobe has 54 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        setupGlobe (domEl, token, options = {}) {
        this.viewerOptions = _.defaults(options, _.get(this, 'activityOptions.engine.viewer', {}), {
        sceneMode: 3, // SceneMode.COLUMBUS_VIEW = 1, SceneMode.SCENE3D = 3,
        sceneModePicker: false,
        infoBox: false,
        Severity: Major
        Found in map/client/mixins/globe/mixin.base-globe.js - About 1 hr to fix

          Function center has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          center (longitude, latitude, altitude, heading = 0, pitch = -90, roll = 0, options = {}) {
          Severity: Major
          Found in map/client/mixins/globe/mixin.base-globe.js - About 50 mins to fix

            Avoid deeply nested control flow statements.
            Open

            if (geoJson.features.length > 0) {
            Object.assign(feature, geoJson.features[0])
            }
            Severity: Major
            Found in map/client/mixins/globe/mixin.base-globe.js - About 45 mins to fix

              Function createCesiumLayer has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
              Open

              async createCesiumLayer (options) {
              let cesiumOptions = options.cesium || options
              // Convert required objects
              cesiumOptions = this.convertToCesiumObjects(cesiumOptions)
              let args = [cesiumOptions]
              Severity: Minor
              Found in map/client/mixins/globe/mixin.base-globe.js - About 45 mins to fix

              Function zoomToBBox has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              zoomToBBox (bbox, heading = 0, pitch = -90, roll = 0, duration = 0) {
              Severity: Minor
              Found in map/client/mixins/globe/mixin.base-globe.js - About 35 mins to fix

                Function zoomToBounds has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                zoomToBounds (bounds, heading = 0, pitch = -90, roll = 0, duration = 0) {
                Severity: Minor
                Found in map/client/mixins/globe/mixin.base-globe.js - About 35 mins to fix

                  Avoid too many return statements within this function.
                  Open

                  return this.viewer.dataSources.contains(cesiumLayer)
                  Severity: Major
                  Found in map/client/mixins/globe/mixin.base-globe.js - About 30 mins to fix

                    TODO found
                    Open

                    // TODO: no specific marker to show yet

                    TODO found
                    Open

                    // TODO

                    FIXME found
                    Open

                    // FIXME: should it be a problem with real-time updates ?

                    TODO found
                    Open

                    // TODO: no specific marker, just keep status
                    Category
                    Status