gecos-team/gecoscc-ui

View on GitHub

Showing 776 of 1,621 total issues

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

        $.fn.scheduler = function scheduler( option ) {
            var args = Array.prototype.slice.call( arguments, 1 );
            var methodReturn;

            var $set = this.each( function() {
Severity: Major
Found in gecoscc/static/js/libs/fuelux.js and 2 other locations - About 7 hrs to fix
gecoscc/static/js/libs/fuelux.js on lines 3649..3668
gecoscc/static/js/libs/fuelux.js on lines 8319..8338

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

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 10 locations. Consider refactoring.
Open

        $.fn.combobox = function( option ) {
            var args = Array.prototype.slice.call( arguments, 1 );
            var methodReturn;

            var $set = this.each( function() {
Severity: Major
Found in gecoscc/static/js/libs/fuelux.js and 9 other locations - About 7 hrs to fix
gecoscc/static/js/libs/fuelux.js on lines 177..196
gecoscc/static/js/libs/fuelux.js on lines 1331..1350
gecoscc/static/js/libs/fuelux.js on lines 1588..1607
gecoscc/static/js/libs/fuelux.js on lines 1923..1942
gecoscc/static/js/libs/fuelux.js on lines 2136..2155
gecoscc/static/js/libs/fuelux.js on lines 2342..2361
gecoscc/static/js/libs/fuelux.js on lines 2622..2641
gecoscc/static/js/libs/fuelux.js on lines 4171..4190
gecoscc/static/js/libs/fuelux.js on lines 4364..4383

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

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 10 locations. Consider refactoring.
Open

        $.fn.search = function( option ) {
            var args = Array.prototype.slice.call( arguments, 1 );
            var methodReturn;

            var $set = this.each( function() {
Severity: Major
Found in gecoscc/static/js/libs/fuelux.js and 9 other locations - About 7 hrs to fix
gecoscc/static/js/libs/fuelux.js on lines 177..196
gecoscc/static/js/libs/fuelux.js on lines 524..543
gecoscc/static/js/libs/fuelux.js on lines 1331..1350
gecoscc/static/js/libs/fuelux.js on lines 1588..1607
gecoscc/static/js/libs/fuelux.js on lines 1923..1942
gecoscc/static/js/libs/fuelux.js on lines 2136..2155
gecoscc/static/js/libs/fuelux.js on lines 2622..2641
gecoscc/static/js/libs/fuelux.js on lines 4171..4190
gecoscc/static/js/libs/fuelux.js on lines 4364..4383

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

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 10 locations. Consider refactoring.
Open

        $.fn.wizard = function( option ) {
            var args = Array.prototype.slice.call( arguments, 1 );
            var methodReturn;

            var $set = this.each( function() {
Severity: Major
Found in gecoscc/static/js/libs/fuelux.js and 9 other locations - About 7 hrs to fix
gecoscc/static/js/libs/fuelux.js on lines 177..196
gecoscc/static/js/libs/fuelux.js on lines 524..543
gecoscc/static/js/libs/fuelux.js on lines 1331..1350
gecoscc/static/js/libs/fuelux.js on lines 1588..1607
gecoscc/static/js/libs/fuelux.js on lines 1923..1942
gecoscc/static/js/libs/fuelux.js on lines 2136..2155
gecoscc/static/js/libs/fuelux.js on lines 2342..2361
gecoscc/static/js/libs/fuelux.js on lines 2622..2641
gecoscc/static/js/libs/fuelux.js on lines 4364..4383

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

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 10 locations. Consider refactoring.
Open

        $.fn.datepicker = function( option ) {
            var args = Array.prototype.slice.call( arguments, 1 );
            var methodReturn;

            var $set = this.each( function() {
Severity: Major
Found in gecoscc/static/js/libs/fuelux.js and 9 other locations - About 7 hrs to fix
gecoscc/static/js/libs/fuelux.js on lines 177..196
gecoscc/static/js/libs/fuelux.js on lines 524..543
gecoscc/static/js/libs/fuelux.js on lines 1588..1607
gecoscc/static/js/libs/fuelux.js on lines 1923..1942
gecoscc/static/js/libs/fuelux.js on lines 2136..2155
gecoscc/static/js/libs/fuelux.js on lines 2342..2361
gecoscc/static/js/libs/fuelux.js on lines 2622..2641
gecoscc/static/js/libs/fuelux.js on lines 4171..4190
gecoscc/static/js/libs/fuelux.js on lines 4364..4383

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

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 10 locations. Consider refactoring.
Open

        $.fn.loader = function( option ) {
            var args = Array.prototype.slice.call( arguments, 1 );
            var methodReturn;

            var $set = this.each( function() {
Severity: Major
Found in gecoscc/static/js/libs/fuelux.js and 9 other locations - About 7 hrs to fix
gecoscc/static/js/libs/fuelux.js on lines 177..196
gecoscc/static/js/libs/fuelux.js on lines 524..543
gecoscc/static/js/libs/fuelux.js on lines 1331..1350
gecoscc/static/js/libs/fuelux.js on lines 1923..1942
gecoscc/static/js/libs/fuelux.js on lines 2136..2155
gecoscc/static/js/libs/fuelux.js on lines 2342..2361
gecoscc/static/js/libs/fuelux.js on lines 2622..2641
gecoscc/static/js/libs/fuelux.js on lines 4171..4190
gecoscc/static/js/libs/fuelux.js on lines 4364..4383

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

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 10 locations. Consider refactoring.
Open

        $.fn.placard = function( option ) {
            var args = Array.prototype.slice.call( arguments, 1 );
            var methodReturn;

            var $set = this.each( function() {
Severity: Major
Found in gecoscc/static/js/libs/fuelux.js and 9 other locations - About 7 hrs to fix
gecoscc/static/js/libs/fuelux.js on lines 177..196
gecoscc/static/js/libs/fuelux.js on lines 524..543
gecoscc/static/js/libs/fuelux.js on lines 1331..1350
gecoscc/static/js/libs/fuelux.js on lines 1588..1607
gecoscc/static/js/libs/fuelux.js on lines 2136..2155
gecoscc/static/js/libs/fuelux.js on lines 2342..2361
gecoscc/static/js/libs/fuelux.js on lines 2622..2641
gecoscc/static/js/libs/fuelux.js on lines 4171..4190
gecoscc/static/js/libs/fuelux.js on lines 4364..4383

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

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 10 locations. Consider refactoring.
Open

        $.fn.infinitescroll = function( option ) {
            var args = Array.prototype.slice.call( arguments, 1 );
            var methodReturn;

            var $set = this.each( function() {
Severity: Major
Found in gecoscc/static/js/libs/fuelux.js and 9 other locations - About 7 hrs to fix
gecoscc/static/js/libs/fuelux.js on lines 177..196
gecoscc/static/js/libs/fuelux.js on lines 524..543
gecoscc/static/js/libs/fuelux.js on lines 1331..1350
gecoscc/static/js/libs/fuelux.js on lines 1588..1607
gecoscc/static/js/libs/fuelux.js on lines 1923..1942
gecoscc/static/js/libs/fuelux.js on lines 2136..2155
gecoscc/static/js/libs/fuelux.js on lines 2342..2361
gecoscc/static/js/libs/fuelux.js on lines 2622..2641
gecoscc/static/js/libs/fuelux.js on lines 4171..4190

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

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 10 locations. Consider refactoring.
Open

        $.fn.selectlist = function( option ) {
            var args = Array.prototype.slice.call( arguments, 1 );
            var methodReturn;

            var $set = this.each( function() {
Severity: Major
Found in gecoscc/static/js/libs/fuelux.js and 9 other locations - About 7 hrs to fix
gecoscc/static/js/libs/fuelux.js on lines 177..196
gecoscc/static/js/libs/fuelux.js on lines 524..543
gecoscc/static/js/libs/fuelux.js on lines 1331..1350
gecoscc/static/js/libs/fuelux.js on lines 1588..1607
gecoscc/static/js/libs/fuelux.js on lines 1923..1942
gecoscc/static/js/libs/fuelux.js on lines 2136..2155
gecoscc/static/js/libs/fuelux.js on lines 2342..2361
gecoscc/static/js/libs/fuelux.js on lines 4171..4190
gecoscc/static/js/libs/fuelux.js on lines 4364..4383

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

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 10 locations. Consider refactoring.
Open

        $.fn.checkbox = function( option ) {
            var args = Array.prototype.slice.call( arguments, 1 );
            var methodReturn;

            var $set = this.each( function() {
Severity: Major
Found in gecoscc/static/js/libs/fuelux.js and 9 other locations - About 7 hrs to fix
gecoscc/static/js/libs/fuelux.js on lines 524..543
gecoscc/static/js/libs/fuelux.js on lines 1331..1350
gecoscc/static/js/libs/fuelux.js on lines 1588..1607
gecoscc/static/js/libs/fuelux.js on lines 1923..1942
gecoscc/static/js/libs/fuelux.js on lines 2136..2155
gecoscc/static/js/libs/fuelux.js on lines 2342..2361
gecoscc/static/js/libs/fuelux.js on lines 2622..2641
gecoscc/static/js/libs/fuelux.js on lines 4171..4190
gecoscc/static/js/libs/fuelux.js on lines 4364..4383

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

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 10 locations. Consider refactoring.
Open

        $.fn.radio = function( option ) {
            var args = Array.prototype.slice.call( arguments, 1 );
            var methodReturn;

            var $set = this.each( function() {
Severity: Major
Found in gecoscc/static/js/libs/fuelux.js and 9 other locations - About 7 hrs to fix
gecoscc/static/js/libs/fuelux.js on lines 177..196
gecoscc/static/js/libs/fuelux.js on lines 524..543
gecoscc/static/js/libs/fuelux.js on lines 1331..1350
gecoscc/static/js/libs/fuelux.js on lines 1588..1607
gecoscc/static/js/libs/fuelux.js on lines 1923..1942
gecoscc/static/js/libs/fuelux.js on lines 2342..2361
gecoscc/static/js/libs/fuelux.js on lines 2622..2641
gecoscc/static/js/libs/fuelux.js on lines 4171..4190
gecoscc/static/js/libs/fuelux.js on lines 4364..4383

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

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

        if not self.options.noinput:
            password = None
            for _n in range(3):
                print("Insert the new password, the spaces will be stripped")
                password_1 = getpass("password [1]: ").strip()
Severity: Major
Found in gecoscc/commands/change_password.py and 1 other location - About 7 hrs to fix
gecoscc/commands/create_adminuser.py on lines 70..88

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

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

        if not self.options.noinput:
            password = None
            for _n in range(3):
                print("Insert the new password, the spaces will be stripped")
                password_1 = getpass("password [1]: ").strip()
Severity: Major
Found in gecoscc/commands/create_adminuser.py and 1 other location - About 7 hrs to fix
gecoscc/commands/change_password.py on lines 54..72

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

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 obj_related['type'] in RESOURCES_RECEPTOR_TYPES:
                try:
                    func = globals()['update_data_%s' % obj_related['type']]
                except KeyError:
                    raise NotImplementedError
Severity: Major
Found in gecoscc/utils.py and 1 other location - About 7 hrs to fix
gecoscc/utils.py on lines 814..824

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

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

    for member in members:
        if member['type'] in RESOURCES_RECEPTOR_TYPES:
            try:
                func = globals()['update_data_%s' % member['type']]
            except KeyError:
Severity: Major
Found in gecoscc/utils.py and 1 other location - About 7 hrs to fix
gecoscc/utils.py on lines 722..731

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

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.$el.find("#ohai_tree-expand")
                .off("click")
                .on("click", function (evt) {
                    evt.preventDefault();
                    $(this).find(".normal").hide();
Severity: Major
Found in gecoscc/static/js/computer.js and 1 other location - About 7 hrs to fix
gecoscc/static/js/computer.js on lines 698..715

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

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.$el.find("#ohai_tree-compress")
                .off("click")
                .on("click", function (evt) {
                    evt.preventDefault();
                    
Severity: Major
Found in gecoscc/static/js/computer.js and 1 other location - About 7 hrs to fix
gecoscc/static/js/computer.js on lines 681..696

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

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

@task(base=ChefTask)
def object_refresh_policies(user, objtype, obj, computers=None):
    self = object_created

    func = getattr(self, '{0}_refresh_policies'.format(objtype), None)
Severity: Major
Found in gecoscc/tasks.py and 1 other location - About 7 hrs to fix
gecoscc/tasks.py on lines 2358..2369

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

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

@task(base=ChefTask)
def object_deleted(user, objtype, obj, computers=None):
    self = object_deleted
    func = getattr(self, '{0}_deleted'.format(objtype), None)
    if func is not None:
Severity: Major
Found in gecoscc/tasks.py and 1 other location - About 7 hrs to fix
gecoscc/tasks.py on lines 2307..2319

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

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

        for mongoObject in collection:
            m = re.match(r'({0})(_\d+)?'.format(nombreBase), mongoObject['name'])
            if m and m.group(2):
                nuevoContador = int(m.group(2)[1:]) + 1
                if (nuevoContador > contador):
Severity: Major
Found in gecoscc/api/ad_import.py and 1 other location - About 6 hrs to fix
gecoscc/api/ad_import.py on lines 387..394

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

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