dverbovyi/angular-heremaps

View on GitHub
src/providers/map-modules/ui/ui.js

Summary

Maintainability
B
6 hrs
Test Coverage

Function HereMapsUiFactory has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function HereMapsUiFactory(HereMapsAPIService, HereMapsMarkerService, HereMapsUtilsService, HereMapsCONSTS) {
    function UI(platform, alignment) {
        this.map = platform.map;
        this.layers = platform.layers;
        this.alignment = alignment;
Severity: Major
Found in src/providers/map-modules/ui/ui.js - About 2 hrs to fix

    Function HereMapsUiFactory has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    function HereMapsUiFactory(HereMapsAPIService, HereMapsMarkerService, HereMapsUtilsService, HereMapsCONSTS) {
        function UI(platform, alignment) {
            this.map = platform.map;
            this.layers = platform.layers;
            this.alignment = alignment;
    Severity: Minor
    Found in src/providers/map-modules/ui/ui.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 createUserControl has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function createUserControl() {
            var self = this,
                userControl = new H.ui.Control(),
                markup = '<svg class="H_icon" fill="#fff" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path class="middle_location_stroke" d="M8 12c-2.206 0-4-1.795-4-4 0-2.206 1.794-4 4-4s4 1.794 4 4c0 2.205-1.794 4-4 4M8 1.25a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5"></path><path class="inner_location_stroke" d="M8 5a3 3 0 1 1 .001 6A3 3 0 0 1 8 5m0-1C5.794 4 4 5.794 4 8c0 2.205 1.794 4 4 4s4-1.795 4-4c0-2.206-1.794-4-4-4"></path><path class="outer_location_stroke" d="M8 1.25a6.75 6.75 0 1 1 0 13.5 6.75 6.75 0 0 1 0-13.5M8 0C3.59 0 0 3.59 0 8c0 4.411 3.59 8 8 8s8-3.589 8-8c0-4.41-3.59-8-8-8"></path></svg>';
    
    
    Severity: Minor
    Found in src/providers/map-modules/ui/ui.js - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status