Z-Wave-Me/home-automation-ui

View on GitHub

Showing 68 of 172 total issues

Function render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        render: function () {
            var _ = React.DOM,
                __ = this.gls;

            return _.div({ className: 'main-component' },
Severity: Minor
Found in js/modules/preferences/components/main_menu.js - About 1 hr to fix

Function getTagsAvailable has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        getTagsAvailable: function () {
            var that = this,
                _ = React.DOM,
                __ = this.gls,
                item_binding = that.getBinding('item'),
Severity: Minor
Found in js/modules/preferences/components/models/_widget.js - About 1 hr to fix

Function render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        render: function () {
            var _ = React.DOM,
                __ = this.gls,
                cx = React.addons.classSet,
                preferences_binding = this.getBinding('preferences'),
Severity: Minor
Found in js/modules/preferences/components/modules_menu.js - About 1 hr to fix

Function renderAlpaca has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        renderAlpaca: function () {
            var that = this,
                preferences_binding = this.getDefaultBinding(),
                data_binding = this.getBinding('data'),
                instance = preferences_binding.sub('instance_temp'),
Severity: Minor
Found in js/modules/preferences/components/modules_components/step3.js - About 1 hr to fix

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

Function r has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                function r(obj) {
                    var key, arr = [];
                    if (obj) {
                        for (key in obj) {
                            if (typeof obj[key] === "object") {
Severity: Minor
Found in js/helpers/js.js - About 1 hr to fix

Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        render: function () {
            var that = this,
                _ = React.DOM,
                binding = this.getDefaultBinding(),
                title = binding.get('metrics.title'),
Severity: Minor
Found in js/modules/widgets/components/_thermostat.js - About 1 hr to fix

Function debounce has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        debounce: function(func, wait, immediate) {
            var timeout, args, context, timestamp, result;

            var later = function() {
                var last = +new Date() - timestamp;
Severity: Minor
Found in js/mixins/data/manipulation.js - About 1 hr to fix

Function init has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        init: function () {
            var that = this,
                ctx = this.getMoreartyContext(),
                defaultBinding = ctx.getBinding().sub('default'),
                servicesBinding = ctx.getBinding().sub('services'),
Severity: Minor
Found in js/mixins/sync/autosync.js - About 1 hr to fix

Function getComponent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        getComponent:function (node) {
            var components = this.components,
                data_binding = this.getBinding('data'),
                preferences_binding = this.getBinding('preferences'),
                component,
Severity: Minor
Found in js/modules/preferences/components/base.js - About 1 hr to fix

Function gls has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        gls: function (key, type) {
            var default_language = this.getDefaultLang(),
                languages_binding = this.getMoreartyContext().getBinding().sub('data.languages'),
                index_lang = languages_binding.get().findIndex(function (lang) {
                    return lang.get('id') === default_language;
Severity: Minor
Found in js/mixins/data/translate.js - About 1 hr to fix

Function r has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            function r(obj) {
                var key, arr = [];
                if (obj) {
                    for (key in obj) {
                        if (typeof obj[key] === "object") {
Severity: Minor
Found in js/mixins/data/manipulation.js - About 1 hr to fix

Function throttle has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        throttle: function(func, wait, options) {
            var context, args, result;
            var timeout = null;
            var previous = 0;
            options || (options = {});
Severity: Minor
Found in js/mixins/data/manipulation.js - About 1 hr to fix

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

        componentWillMount: function () {
            var that = this;

            that.getBinding('data').addListener('devicesOnDashboard', function () {
                if (that.isMounted()) {
Severity: Minor
Found in js/modules/widgets/main.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 (filtered.toArray().length > 0) {
                                            namespace = filtered.toArray()[0].toJS();
                                            if (namespace) { // check that it existsd in namespaces
                                                arr = arr.concat(namespace.params.map(function (para) {
                                                    return para[val.split(':')[2]];
Severity: Major
Found in js/helpers/js.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

Avoid deeply nested control flow statements.
Open

                                    if (filtered.toArray().length > 0) {
                                        namespace = filtered.toArray()[0].toJS();
                                        if (namespace) { // check that it existsd in namespaces
                                            arr = arr.concat(namespace.params.map(function (para) {
                                                return para[val.split(':')[2]];
Severity: Major
Found in js/mixins/data/manipulation.js - About 45 mins to fix

Avoid too many return statements within this function.
Open

                    return text;
Severity: Major
Found in js/mixins/data/translate.js - About 30 mins to fix
Severity
Category
Status
Source
Language