Z-Wave-Me/home-automation-ui

View on GitHub
js/mixins/data/data-layer.js

Summary

Maintainability
A
3 hrs
Test Coverage

Function _r has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _r: function (obj) {
            var namespace, that = this, key, arr = [];

            if (obj) {
                for (key in obj) {
Severity: Minor
Found in js/mixins/data/data-layer.js - About 1 hr to fix

Avoid deeply nested control flow statements.
Open

                        if (obj[key].indexOf('namespaces') !== -1 && obj[key].split(':').length > 1) {
                            obj[key].split(',').forEach(function (val) {
                                namespace = that._getNamespace(val.split(':')[1], val.split(':')[2]) || [];
                                if (namespace) {
                                    arr = arr.concat(namespace);
Severity: Major
Found in js/mixins/data/data-layer.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                            if (!obj[key].hasOwnProperty('toolbarSticky')) {
                                obj[key].toolbarSticky = true;
                            }
Severity: Major
Found in js/mixins/data/data-layer.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                            if (!obj[key].hasOwnProperty('helper')) {
                                obj[key].helper = '';
                            }
Severity: Major
Found in js/mixins/data/data-layer.js - About 45 mins to fix

There are no issues that match your filters.

Category
Status