devworkstecnology/webadmin

View on GitHub

Showing 202 of 202 total issues

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

    $(function () {
        $('body').on('mousedown.pillbox.data-api', '.pillbox', function (e) {
            var $this = $(this);
            if ($this.data('pillbox')) return;
            $this.pillbox($this.data());
Severity: Major
Found in vendor/assets/javascripts/fuelux/fuelux.js and 1 other location - About 2 hrs to fix
vendor/assets/javascripts/fuelux/fuelux.js on lines 1135..1141

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

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

                                while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
                                    pos += (key === BACKSPACE || key === DEL) ? -1 : 1;
                                }
Severity: Major
Found in vendor/assets/javascripts/jquery.datetimepicker.js and 1 other location - About 2 hrs to fix
vendor/assets/javascripts/jquery.datetimepicker.js on lines 1100..1102

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

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

    $(function () {
        $('body').on('mousedown.spinner.data-api', '.spinner', function (e) {
            var $this = $(this);
            if ($this.data('spinner')) return;
            $this.spinner($this.data());
Severity: Major
Found in vendor/assets/javascripts/fuelux/fuelux.js and 1 other location - About 2 hrs to fix
vendor/assets/javascripts/fuelux/fuelux.js on lines 705..711

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

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

    $(function () {
        $('body').on('mousedown.wizard.data-api', '.wizard', function () {
            var $this = $(this);
            if ($this.data('wizard')) return;
            $this.wizard($this.data());
Severity: Major
Found in vendor/assets/javascripts/fuelux/fuelux.js and 1 other location - About 2 hrs to fix
vendor/assets/javascripts/fuelux/fuelux.js on lines 936..942

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

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

    $(function () {
        $('body').on('mousedown.search.data-api', '.search', function () {
            var $this = $(this);
            if ($this.data('search')) return;
            $this.search($this.data());
Severity: Major
Found in vendor/assets/javascripts/fuelux/fuelux.js and 1 other location - About 2 hrs to fix
vendor/assets/javascripts/fuelux/fuelux.js on lines 1637..1643

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

        data: function (options, callback) {
            var url = 'js/data/datagrid.json';
            var self = this;

            setTimeout(function () {
Severity: Major
Found in vendor/assets/javascripts/app.data.js - About 2 hrs to fix

    Function setValue has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            setValue: function(value) {
                if(!value) {
                    return;
                }
                
    Severity: Major
    Found in vendor/assets/javascripts/combodate/combodate.js - About 2 hrs to fix

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

        Tooltip.prototype.show = function () {
          var e = $.Event('show.bs.' + this.type)
      
          if (this.hasContent() && this.enabled) {
            this.$element.trigger(e)
      Severity: Minor
      Found in vendor/assets/javascripts/bootstrap.js - About 2 hrs to fix

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

          factory :web_admin_user, :class => 'WebAdmin::User' do
            email "user@email.com"
            password "12345678"
            password_confirmation "12345678"
        
        
        Severity: Major
        Found in spec/factories/admin_web_users.rb and 1 other location - About 1 hr to fix
        spec/test_app/spec/factories/admin_web_users.rb on lines 2..19

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

        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

          factory :web_admin_user, :class => 'WebAdmin::User' do
            email "user@email.com"
            password "12345678"
            password_confirmation "12345678"
        
        
        Severity: Major
        Found in spec/test_app/spec/factories/admin_web_users.rb and 1 other location - About 1 hr to fix
        spec/factories/admin_web_users.rb on lines 2..19

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

        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 (typeof this.minViewMode === 'string') {
                    switch (this.minViewMode) {
                        case 'months':
                            this.minViewMode = 1;
                            break;
        vendor/assets/javascripts/datepicker/bootstrap-datepicker.js on lines 65..77

        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 (typeof this.viewMode === 'string') {
                    switch (this.viewMode) {
                        case 'months':
                            this.viewMode = 1;
                            break;
        vendor/assets/javascripts/datepicker/bootstrap-datepicker.js on lines 51..63

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

          Carousel.prototype.slide = function (type, next) {
            var $active   = this.$element.find('.item.active')
            var $next     = next || $active[type]()
            var isCycling = this.interval
            var direction = type == 'next' ? 'left' : 'right'
        Severity: Minor
        Found in vendor/assets/javascripts/bootstrap.js - About 1 hr to fix

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

              var Datagrid = function (element, options) {
                  this.$element = $(element);
                  this.$thead = this.$element.find('thead');
                  this.$tfoot = this.$element.find('tfoot');
                  this.$footer = this.$element.find('tfoot th');
          Severity: Minor
          Found in vendor/assets/javascripts/fuelux/fuelux.js - About 1 hr to fix

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

              $(window).on('load', function () {
                $('[data-ride="carousel"]').each(function () {
                  var $carousel = $(this)
                  $carousel.carousel($carousel.data())
                })
            Severity: Major
            Found in vendor/assets/javascripts/bootstrap.js and 1 other location - About 1 hr to fix
            vendor/assets/javascripts/bootstrap.js on lines 1680..1685

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

            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

              $(window).on('load', function () {
                $('[data-spy="scroll"]').each(function () {
                  var $spy = $(this)
                  $spy.scrollspy($spy.data())
                })
            Severity: Major
            Found in vendor/assets/javascripts/bootstrap.js and 1 other location - About 1 hr to fix
            vendor/assets/javascripts/bootstrap.js on lines 452..457

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

            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

                                $([document.body, window]).on('mouseup.xdsoft', function arguments_callee2() {
                                    clearTimeout(timer);
                                    stop = true;
                                    $([document.body, window]).off('mouseup.xdsoft', arguments_callee2);
                                });
            Severity: Major
            Found in vendor/assets/javascripts/jquery.datetimepicker.js and 1 other location - About 1 hr to fix
            vendor/assets/javascripts/jquery.datetimepicker.js on lines 1438..1443

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

            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 (year !== _xdsoft_datetime.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
                                    options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
                                }
            Severity: Major
            Found in vendor/assets/javascripts/jquery.datetimepicker.js and 1 other location - About 1 hr to fix
            vendor/assets/javascripts/jquery.datetimepicker.js on lines 1266..1268

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

            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 (year !== _this.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
                                    options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
                                }
            Severity: Major
            Found in vendor/assets/javascripts/jquery.datetimepicker.js and 1 other location - About 1 hr to fix
            vendor/assets/javascripts/jquery.datetimepicker.js on lines 870..872

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

            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

                                $([document.body, window]).on('mouseup.xdsoft', function arguments_callee5() {
                                    clearTimeout(timer);
                                    stop = true;
                                    $([document.body, window])
                                        .off('mouseup.xdsoft', arguments_callee5);
            Severity: Major
            Found in vendor/assets/javascripts/jquery.datetimepicker.js and 1 other location - About 1 hr to fix
            vendor/assets/javascripts/jquery.datetimepicker.js on lines 1409..1413

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

            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