Z-Wave-Me/home-automation-ui

View on GitHub

Showing 172 of 172 total issues

Function pull has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        pull: function () {
            var that = this,
                functions = {},
                ctx = that.getMoreartyContext(),
                servicesBinding = ctx.getBinding().sub('services'),
Severity: Major
Found in js/mixins/sync/autosync.js - About 3 hrs to fix

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

        componentDidMount: function () {
            var that = this,
                color = '#40e8f0',
                radius = 50,
                border = 15,
Severity: Major
Found in js/modules/widgets/common/level_selector.js - About 3 hrs to fix

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

        render: function () {
            var _ = React.DOM,
                cx = React.addons.classSet;

            return _.div({onClick: this.stopPropagationAndPreventDefault, key:'picker-container', className: 'picker-container cp-small'},
Severity: Major
Found in js/modules/widgets/common/color_picker.js - About 3 hrs to fix

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

        render: function () {
            var that = this,
                cx = React.addons.classSet,
                preferencesBinding = that.getBinding('preferences'),
                dataBinding = that.getBinding('data'),
Severity: Major
Found in js/modules/preferences/components/models/_room.js - About 2 hrs to fix

File _widget.js has 274 lines of code (exceeds 250 allowed). Consider refactoring.
Open

define([
    // components
    '../common/_buttons_group',
    '../common/_inline_input',
    'mixins/data/data-layer',
Severity: Minor
Found in js/modules/preferences/components/models/_widget.js - About 2 hrs to fix

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

                                _.linearGradient({
                                    id: 'gradient-white',
                                    x1: '0%',
                                    y1: '100%',
                                    x2: '100%',
Severity: Major
Found in js/modules/widgets/common/color_picker.js and 1 other location - About 2 hrs to fix
js/modules/widgets/common/color_picker.js on lines 213..222

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

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

                                _.linearGradient({
                                    id: 'gradient-black',
                                    x1: '0%',
                                    y1: '100%',
                                    x2: '0%',
Severity: Major
Found in js/modules/widgets/common/color_picker.js and 1 other location - About 2 hrs to fix
js/modules/widgets/common/color_picker.js on lines 223..232

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

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

                    !this.state.saved ? _.div({
                            key: 'save-button',
                            className: 'modern-button green-mode center',
                            onClick: this.onSaveInstanceHandler.bind(null, item_binding)
                        }, 'Save', this.state.loading ? _.div({ className: 'spinner' }) : null
Severity: Major
Found in js/modules/preferences/components/models/instance.js and 1 other location - About 2 hrs to fix
js/modules/preferences/components/models/instance.js on lines 114..119

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

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

                    !this.state.saved ? _.div({
                            key: 'remove-button',
                            className: 'modern-button red-mode center',
                            onClick: this.onRemoveInstanceHandler.bind(null, item_binding)
                        }, 'Remove', this.state.loading ? _.div({ className: 'spinner' }) : null
Severity: Major
Found in js/modules/preferences/components/models/instance.js and 1 other location - About 2 hrs to fix
js/modules/preferences/components/models/instance.js on lines 108..113

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

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

File color_picker.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
Open

define([
    // mixins
    'mixins/sync/sync-layer',
    'mixins/data/manipulation',
    'mixins/ui/color-manipulation',
Severity: Minor
Found in js/modules/widgets/common/color_picker.js - About 2 hrs to fix

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

        componentWillMount: function () {
            var that = this,
                preferences_binding = that.getBinding('preferences');

            preferences_binding.addListener('activeNodeTreeStatus', function () {
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 20..30
js/modules/preferences/components/models/_widget.js on lines 20..30

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

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

        componentWillMount: function () {
            var that = this,
                preferences_binding = that.getBinding('preferences');

            preferences_binding.addListener('activeNodeTreeStatus', function () {
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 24..34
js/modules/preferences/components/models/_widget.js on lines 20..30

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

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 render has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        render: function () {
            var _ = React.DOM,
                binding = this.getDefaultBinding(),
                metrics_binding = binding.sub('metrics'),
                device_type = binding.get('deviceType'),
Severity: Major
Found in js/modules/widgets/components/base.js - About 2 hrs to fix

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

        componentWillMount: function () {
            var that = this,
                preferences_binding = that.getBinding('preferences');

            preferences_binding.addListener('activeNodeTreeStatus', function () {
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 24..34
js/modules/preferences/components/models/_room.js on lines 20..30

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

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 getModule has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        getModule: function (_module) {
            var _ = React.DOM,
                __ = this.gls,
                defaults = _module.get('defaults'),
                id = _module.get('id'),
Severity: Major
Found in js/modules/preferences/components/modules_components/step1.js - About 2 hrs to fix

Function getNamespacesData has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            getNamespacesData: function (ctx, model) {
                var data_binding = ctx.getBinding().sub('data'),
                    namespaces = data_binding.sub('namespaces'),
                    options = model.options,
                    defaultObject = {
Severity: Major
Found in js/helpers/js.js - About 2 hrs to fix

Function getNamespacesData has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        getNamespacesData: function (ctx, model) {
            var data_binding = ctx.getBinding().sub('data'),
                namespaces = data_binding.sub('namespaces'),
                options = model.options,
                defaultObject = {
Severity: Major
Found in js/mixins/data/manipulation.js - About 2 hrs to fix

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

        render: function () {
            var _ = React.DOM,
                __ = this.gls,
                preferences_binding = this.getDefaultBinding(),
                instance_binding = preferences_binding.sub('instance_temp'),
Severity: Major
Found in js/modules/preferences/components/modules_components/step2.js - About 2 hrs to fix

Function postSyncHandler has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                postSyncHandler: function (ctx, response, collection, xhr) {
                    var that = this,
                        remove_devices_ids,
                        dataBinding = ctx.getBinding().sub('data'),
                        devices_binding = dataBinding.sub('devices');
Severity: Major
Found in js/state/services.js - About 2 hrs to fix

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/common/level_selector.js and 1 other location - About 2 hrs to fix
js/modules/widgets/components/_thermostat.js on lines 95..102

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

Severity
Category
Status
Source
Language