Z-Wave-Me/home-automation-ui

View on GitHub

Showing 172 of 172 total issues

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

            foreground = meter.append('path')
                .attr('class', 'foreground')
                .attr('fill', color)
                .attr('fill-opacity', 1)
                .attr('stroke', color)
Severity: Major
Found in js/modules/widgets/components/_thermostat.js and 1 other location - About 2 hrs to fix
js/modules/widgets/common/level_selector.js on lines 82..89

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

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

Function componentDidMount has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        componentDidMount: function () {
            var that = this,
                color = '#40e8f0',
                radius = 20,
                border = 5,
Severity: Major
Found in js/modules/widgets/components/_thermostat.js - About 2 hrs to fix

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

                            temp_string.length > 1 ? _.div({className: 'autocomplete-box autocomplete-device'},
                            _.button({
                                className: 'close-button',
                                onClick: that.onBlurHandler
                            }, '✖'),
Severity: Major
Found in js/modules/preferences/components/models/_room.js and 2 other locations - About 2 hrs to fix
js/modules/preferences/components/models/_profile.js on lines 107..115
js/modules/preferences/components/models/_widget.js on lines 173..181

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

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

                        temp_string.length > 1 ? _.div({className: 'autocomplete-box autocomplete-device'},
                            _.button({
                                className: 'close-button',
                                onClick: that.onBlurHandler
                            }, '✖'),
Severity: Major
Found in js/modules/preferences/components/models/_widget.js and 2 other locations - About 2 hrs to fix
js/modules/preferences/components/models/_profile.js on lines 107..115
js/modules/preferences/components/models/_room.js on lines 122..130

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

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

                        temp_string.length > 1 ? _.div({className: 'autocomplete-box autocomplete-device'},
                            _.button({
                                className: 'close-button',
                                onClick: that.onBlurHandler
                            }, '✖'),
Severity: Major
Found in js/modules/preferences/components/models/_profile.js and 2 other locations - About 2 hrs to fix
js/modules/preferences/components/models/_room.js on lines 122..130
js/modules/preferences/components/models/_widget.js on lines 173..181

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

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

Function getButtons has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Severity: Major
Found in js/modules/preferences/components/common/_buttons_group.js - About 2 hrs to fix

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

        render: function () {
            var _ = React.DOM,
                __ = this.gls,
                cx = React.addons.classSet,
                binding = this.getDefaultBinding(),
Severity: Minor
Found in js/modules/core/components/header.js - About 2 hrs to fix

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

        render: function () {
            var _ = React.DOM,
                binding = this.getDefaultBinding();

            return _.div({
Severity: Minor
Found in js/modules/widgets/common/level_selector.js - About 1 hr to fix

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

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

Function getInitialState has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        getInitialState: function () {
            return {
                show: false,
                options: { // pair option - command
                    "hasZoomIn": {
Severity: Minor
Found in js/modules/widgets/components/_camera.js - About 1 hr to fix

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

                        Morearty.DOM.input({
                                className: 'ios-switch green',
                                type: 'checkbox',
                                checked: item.get('permanently_hidden'),
                                onChange: this.PermanentlyHiddenHandler
Severity: Major
Found in js/modules/preferences/components/models/_widget.js and 1 other location - About 1 hr to fix
js/modules/preferences/components/instances_menu.js on lines 56..65

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

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

                                Morearty.DOM.input({
                                        className: 'ios-switch',
                                        type: 'checkbox',
                                        checked: preferences_binding.get('show_turned_off'),
                                        onChange: this.onShowTurnedOffHandler
Severity: Major
Found in js/modules/preferences/components/instances_menu.js and 1 other location - About 1 hr to fix
js/modules/preferences/components/models/_widget.js on lines 208..217

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

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

            if (type === 'increase') {
                this.setState({current_level: this.state.current_level + 1 <= this.state.max_level ? this.state.current_level + 1 : this.state.max_level});
            } else if (type === 'decrease') {
                this.setState({current_level: this.state.current_level - 1 >= this.state.min_level ? this.state.current_level - 1 : this.state.min_level});
            } else if (type === 'max') {
Severity: Major
Found in js/modules/widgets/common/level_selector.js and 1 other location - About 1 hr to fix
js/modules/widgets/common/level_selector.js on lines 153..159

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

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

            } else if (type === 'decrease') {
                this.setState({current_level: this.state.current_level - 1 >= this.state.min_level ? this.state.current_level - 1 : this.state.min_level});
            } else if (type === 'max') {
                this.setState({current_level: this.state.max_level});
            } else if (type === 'min') {
Severity: Major
Found in js/modules/widgets/common/level_selector.js and 1 other location - About 1 hr to fix
js/modules/widgets/common/level_selector.js on lines 151..159

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

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

Function getCategory has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        getCategory: function (category) {
            var that = this,
                _ = React.DOM,
                cx = React.addons.classSet,
                data_binding = this.getBinding('data'),
Severity: Minor
Found in js/modules/preferences/components/modules_components/step1.js - About 1 hr to fix

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

        render: function () {
            var _ = React.DOM,
                __ = this.gls,
                binding = this.getDefaultBinding(),
                preferencesBinding = this.getBinding('preferences'),
Severity: Minor
Found in js/modules/preferences/main.js - About 1 hr to fix

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

        render: function () {
            var _ = React.DOM,
                that = this,
                data_binding = this.getBinding('data'),
                instances_binding = data_binding.sub('instances'),
Severity: Minor
Found in js/modules/preferences/components/instances_menu.js - About 1 hr to fix

Function request has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        request: function (options) {
            var that = this,
                xhr = new XMLHttpRequest(),
                query = this._getQueryParams(window.location.search),
                apiPort = query.hasOwnProperty('port') ? query.port : window.location.port,
Severity: Minor
Found in js/mixins/sync/xhr.js - About 1 hr to fix

Function getModels has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        getModels: function () {
            var that = this,
                _ = React.DOM,
                preferencesBinding = this.getBinding('preferences'),
                dataBinding = this.getBinding('data'),
Severity: Minor
Found in js/modules/preferences/components/common/_base_left_panel.js - About 1 hr to fix

Function removeHandler has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        removeHandler: function () {
            var that = this,
                item = that.getBinding('item'),
                items = that.getBinding('items'),
                index = items.get().indexOf(item.get()),
Severity: Minor
Found in js/modules/preferences/components/common/_buttons_group.js - About 1 hr to fix
Severity
Category
Status
Source
Language