joshsoftware/code-curiosity

View on GitHub

Showing 64 of 64 total issues

File bootstrap-multiselect.js has 896 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Bootstrap Multiselect (https://github.com/davidstutz/bootstrap-multiselect)
 * 
 * Apache License, Version 2.0:
 * Copyright (c) 2012 - 2015 David Stutz
Severity: Major
Found in app/assets/javascripts/bootstrap-multiselect.js - About 2 days to fix

    Function BarRating has 264 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var BarRating = (function() {
    
            function BarRating() {
                var self = this;
    
    
    Severity: Major
    Found in app/assets/javascripts/jquery.barrating.js - About 1 day to fix

      Function BarRating has 256 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function BarRating() {
                  var self = this;
      
                  // wrap element in a wrapper div
                  var wrapElement = function() {
      Severity: Major
      Found in app/assets/javascripts/jquery.barrating.js - About 1 day to fix

        Function buildDropdownOptions has 165 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                buildDropdownOptions: function() {
        
                    this.$select.children().each($.proxy(function(index, element) {
        
                        var $element = $(element);
        Severity: Major
        Found in app/assets/javascripts/bootstrap-multiselect.js - About 6 hrs to fix

          File mustache.js has 383 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*!
           * mustache.js - Logic-less {{mustache}} templates with JavaScript
           * http://github.com/janl/mustache.js
           */
          
          
          Severity: Minor
          Found in app/assets/javascripts/mustache.js - About 5 hrs to fix

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

                series: [{
                  name: 'Users',
                  data: users,
                  marker: { enabled: true },
                  color: '#3C8DBC',
            Severity: Major
            Found in app/assets/javascripts/home.js and 1 other location - About 5 hrs to fix
            app/assets/javascripts/home.js on lines 39..52

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

            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

                series: [{
                  name: 'Commits',
                  data: commits,
                  marker: { enabled: true },
                  color: '#00A65A',
            Severity: Major
            Found in app/assets/javascripts/home.js and 1 other location - About 5 hrs to fix
            app/assets/javascripts/home.js on lines 104..117

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

            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

              componentDidMount() {
                $.ajax({
                  type: 'GET',
                  url: '/subscriptions',
                  data: {id: this.props.user_id },
            app/assets/javascripts/components/points_history.es6.jsx on lines 7..17

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

            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

              componentDidMount() {
                $.ajax({
                  type: 'GET',
                  url: '/transactions',
                  data: { id: this.props.user_id },
            Severity: Major
            Found in app/assets/javascripts/components/points_history.es6.jsx and 1 other location - About 4 hrs to fix
            app/assets/javascripts/components/subscriptions_history.es6.jsx on lines 7..17

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

            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 (options.length === 0) {
                                return this.nonSelectedText;
                            }
                            else {
                                var selected = '';
            Severity: Major
            Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 4 hrs to fix
            app/assets/javascripts/bootstrap-multiselect.js on lines 209..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 121.

            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 (options.length > this.numberDisplayed) {
                                return options.length + ' ' + this.nSelectedText;
                            }
                            else {
                                var selected = '';
            Severity: Major
            Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 4 hrs to fix
            app/assets/javascripts/bootstrap-multiselect.js on lines 232..244

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

            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 (allBindings.has('value')) {
                                var value = allBindings.get('value');
                                if (ko.isObservable(value)) {
                                    ko.computed({
                                        read: function() {
            Severity: Major
            Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 3 hrs to fix
            app/assets/javascripts/bootstrap-multiselect.js on lines 95..108

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

            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 (allBindings.has('selectedOptions')) {
                                var selectedOptions = allBindings.get('selectedOptions');
                                if (ko.isObservable(selectedOptions)) {
                                    ko.computed({
                                        read: function() {
            Severity: Major
            Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 3 hrs to fix
            app/assets/javascripts/bootstrap-multiselect.js on lines 78..91

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

            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

                    getInputByValue: function (value) {
            
                        var checkboxes = $('li input', this.$ul);
                        var valueToCompare = value.toString();
            
            
            Severity: Major
            Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 3 hrs to fix
            app/assets/javascripts/bootstrap-multiselect.js on lines 1336..1347

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

            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

                    getOptionByValue: function (value) {
            
                        var options = $('option', this.$select);
                        var valueToCompare = value.toString();
            
            
            Severity: Major
            Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 3 hrs to fix
            app/assets/javascripts/bootstrap-multiselect.js on lines 1355..1366

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

            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 jquery.barrating.js has 320 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * jQuery Bar Rating Plugin v1.1.3
             *
             * http://github.com/antennaio/jquery-bar-rating
             *
            Severity: Minor
            Found in app/assets/javascripts/jquery.barrating.js - About 3 hrs to fix

              Function parseTemplate has 83 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function parseTemplate(template, tags) {
                  template = template || '';
                  tags = tags || mustache.tags;
              
                  if (typeof tags === 'string') tags = tags.split(spaceRe);
              Severity: Major
              Found in app/assets/javascripts/mustache.js - About 3 hrs to fix

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

                  $(document).on('change', '.secondary', function(){
                    id = this.id;
                    $(".secondary#"+id).prop('disabled', true);
                    $.ajax({
                      type: 'patch',
                Severity: Major
                Found in app/assets/javascripts/admin/repositories.js and 1 other location - About 3 hrs to fix
                app/assets/javascripts/admin/ignored_files.js on lines 17..25

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

                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).on('change', '.primary', function(){
                    id = this.id;
                    $(".primary#"+id).prop('disabled', true);
                    $.ajax({
                        type: 'patch',
                Severity: Major
                Found in app/assets/javascripts/admin/ignored_files.js and 1 other location - About 3 hrs to fix
                app/assets/javascripts/admin/repositories.js on lines 16..24

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

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

                        buildFilter: function() {
                
                            // Build filter if filtering OR case insensitive filtering is enabled and the number of options exceeds (or equals) enableFilterLength.
                            if (this.options.enableFiltering || this.options.enableCaseInsensitiveFiltering) {
                                var enableFilterLength = Math.max(this.options.enableFiltering, this.options.enableCaseInsensitiveFiltering);
                Severity: Major
                Found in app/assets/javascripts/bootstrap-multiselect.js - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language