Z-Wave-Me/home-automation-ui

View on GitHub

Showing 172 of 172 total issues

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 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 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 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 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 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 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 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

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            meter.append('path')
                .attr('class', 'background')
                .attr('fill', '#ccc')
                .attr('fill-opacity', 0.5)
                .attr('d', arc.endAngle(twoPi));
Severity: Major
Found in js/modules/widgets/components/_thermostat.js and 2 other locations - About 1 hr to fix
js/modules/widgets/common/level_selector.js on lines 67..71
js/modules/widgets/common/level_selector.js on lines 76..80

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            meter.append('path')
                .attr('class', 'background')
                .attr('fill', '#ccc')
                .attr('fill-opacity', 0.5)
                .attr('d', arc.endAngle(twoPi));
Severity: Major
Found in js/modules/widgets/common/level_selector.js and 2 other locations - About 1 hr to fix
js/modules/widgets/common/level_selector.js on lines 76..80
js/modules/widgets/components/_thermostat.js on lines 89..93

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            meter2.append('path')
                .attr('class', 'background')
                .attr('fill', '#ccc')
                .attr('fill-opacity', 0.5)
                .attr('d', arc2.endAngle(twoPi));
Severity: Major
Found in js/modules/widgets/common/level_selector.js and 2 other locations - About 1 hr to fix
js/modules/widgets/common/level_selector.js on lines 67..71
js/modules/widgets/components/_thermostat.js on lines 89..93

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                        success: function (response) {
                            that.getBinding('data').set('namespaces', Immutable.fromJS(response.data));
                            that.renderAlpaca(id);
                        }
Severity: Minor
Found in js/modules/preferences/components/instances_menu.js and 1 other location - About 55 mins to fix
js/modules/preferences/components/models/instance.js on lines 146..149

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                        success: function (response) {
                            that.getBinding('data').set('namespaces', Immutable.fromJS(response.data));
                            that.renderAlpaca(id);
                        }
Severity: Minor
Found in js/modules/preferences/components/models/instance.js and 1 other location - About 55 mins to fix
js/modules/preferences/components/instances_menu.js on lines 103..106

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                } else if (primaryFilter === 'types') {
                    return dataBinding.get('deviceTypes').count() > 0 ? FilterTypes({binding: { default: binding, data: dataBinding }}) : null;
                } else if (primaryFilter === 'tags') {
                    return dataBinding.get('deviceTags').count() > 0 ? FilterTags({binding: { default: binding, data: dataBinding }}) : null;
                } else {
Severity: Major
Found in js/modules/core/components/filters.js and 2 other locations - About 55 mins to fix
js/modules/core/components/filters.js on lines 31..39
js/modules/core/components/filters.js on lines 35..39

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                if (primaryFilter === 'rooms') {
                    return dataBinding.get('locations').count() > 0 ? FilterRooms({binding: { default: binding, data: dataBinding }}) : null;
                } else if (primaryFilter === 'types') {
                    return dataBinding.get('deviceTypes').count() > 0 ? FilterTypes({binding: { default: binding, data: dataBinding }}) : null;
                } else if (primaryFilter === 'tags') {
Severity: Major
Found in js/modules/core/components/filters.js and 2 other locations - About 55 mins to fix
js/modules/core/components/filters.js on lines 33..39
js/modules/core/components/filters.js on lines 35..39

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                } else if (primaryFilter === 'tags') {
                    return dataBinding.get('deviceTags').count() > 0 ? FilterTags({binding: { default: binding, data: dataBinding }}) : null;
                } else {
                    return null;
                }
Severity: Major
Found in js/modules/core/components/filters.js and 2 other locations - About 55 mins to fix
js/modules/core/components/filters.js on lines 31..39
js/modules/core/components/filters.js on lines 33..39

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

            var that = this,
                ctx = that.getMoreartyContext(),
                dataBinding = ctx.getBinding().sub('data'),
                collection_binding = dataBinding.sub(collection_name);
Severity: Major
Found in js/mixins/sync/sync-layer.js and 2 other locations - About 50 mins to fix
js/mixins/sync/sync-layer.js on lines 167..170
js/mixins/sync/sync-layer.js on lines 202..205

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                front2.attr('d', arc2.endAngle(twoPi * (current_level - that.state.min_level) / that.state.step / 100));
Severity: Minor
Found in js/modules/widgets/common/level_selector.js and 1 other location - About 50 mins to fix
js/modules/widgets/common/level_selector.js on lines 124..124

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                    _.div({ key: 'form-deviceType-input', className: 'data-group'},
                        _.span({className: 'label-item'}, 'deviceType'),
                        _.span({className: 'value-item'}, deviceType)
                    ),
Severity: Minor
Found in js/modules/preferences/components/models/_widget.js and 1 other location - About 50 mins to fix
js/modules/preferences/components/models/_widget.js on lines 131..134

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

            var that = this,
                ctx = that.getMoreartyContext(),
                dataBinding = ctx.getBinding().sub('data'),
                collection_binding = dataBinding.sub(collection_name);
Severity: Major
Found in js/mixins/sync/sync-layer.js and 2 other locations - About 50 mins to fix
js/mixins/sync/sync-layer.js on lines 188..191
js/mixins/sync/sync-layer.js on lines 202..205

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language