concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

Consider simplifying this complex logical expression.
Open

      if ((!(this.tinymceOptions.theme_advanced_buttons1 && this.tinymceOptions.theme_advanced_buttons1.match(/(^|,)save(,|$)/)) &&
           !(this.tinymceOptions.theme_advanced_buttons2 && this.tinymceOptions.theme_advanced_buttons2.match(/(^|,)save(,|$)/)) &&
           !(this.tinymceOptions.theme_advanced_buttons3 && this.tinymceOptions.theme_advanced_buttons3.match(/(^|,)save(,|$)/))) ||
          (this.tinymceOptions.plugins == undefined || !this.tinymceOptions.plugins.match(/(^|,)save(,|$)/))) {
        throw("InPlaceRichEditor' tinymceSave option require at least the save button and the save plugin in tinyMCE initialization.");
Severity: Critical
Found in rails/app/assets/javascripts/in_place_rich_editor/inplacericheditor.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

        elsif researcher_view && class_researcher?
          true
        else
          class_student? &&
          record &&
    Severity: Critical
    Found in rails/app/policies/portal/offering_policy.rb - About 1 hr to fix

      Function draw has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          draw: function() {
              var el = this.targetElement,
                  props = this.styleInfos.borderInfo.getProps(),
                  bounds = this.boundsInfo.getBounds(),
                  w = bounds.w,
      Severity: Minor
      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

        Function clone has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            clone: function( elem, dataAndEvents, deepDataAndEvents ) {
                var srcElements,
                    destElements,
                    i,
                    clone;
        Severity: Minor
        Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

          Function offset has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          jQuery.fn.offset = function( options ) {
              if ( arguments.length ) {
                  return options === undefined ?
                      this :
                      this.each(function( i ) {
          Severity: Minor
          Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

            Function add has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                   add: function(newLocation, historyData) {
                           
                           var that = this;
                           
                           /*Escape the location and remove any leading hash symbols*/

              Function onKeyPress has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                onKeyPress: function(event) {
                  if(this.active)
                    switch(event.keyCode) {
                     case Event.KEY_TAB:
                     case Event.KEY_RETURN:
              Severity: Minor
              Found in rails/app/assets/javascripts/controls.js - About 1 hr to fix

                Function constructCanvas has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    constructCanvas: function(){
                        var el = this.el,
                            size, c, oc;
                        
                        // The old canvases are retrieved to avoid memory leaks ...
                Severity: Minor
                Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 1 hr to fix

                  Function constructCanvas has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      constructCanvas: function(){
                          var el = this.el,
                              size, c, oc;
                          
                          // The old canvases are retrieved to avoid memory leaks ...
                  Severity: Minor
                  Found in rails/app/assets/javascripts/flotr/flotr.js - About 1 hr to fix

                    Method initialize has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def initialize(offering, protocol, host_with_port, current_user, additional_external_report_id, anonymize_students = false)
                        runnable = offering.runnable
                        self.id = offering.id
                        self.teacher = offering.clazz.teacher.name
                        self.clazz = offering.clazz.name
                    Severity: Minor
                    Found in rails/app/models/api/v1/offering.rb - About 1 hr to fix

                      Function draw has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        draw: function(event) {
                          var pointer = [Event.pointerX(event), Event.pointerY(event)];
                          var style = this.element.style;
                          if (this.currentDirection.indexOf('n') != -1) {
                              var pointerMoved = this.startY - pointer[1];
                      Severity: Minor
                      Found in rails/app/assets/javascripts/misc/resizable.js - About 1 hr to fix

                        Method to_sc has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def to_sc
                              str = ''
                              if @scheme
                                str << @scheme
                                str << ':'
                        Severity: Minor
                        Found in rails/config/initializers/00_core_extensions.rb - About 1 hr to fix

                          Method resolve has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def resolve
                                if user.has_role?('manager','admin','researcher')
                                  all
                                elsif user.is_project_admin? || user.is_project_researcher?
                                  where = []
                          Severity: Minor
                          Found in rails/app/policies/report/learner_policy.rb - About 1 hr to fix

                            Function renderInput has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              renderInput (name: any, titleOverride?: any) {
                                if (!this.state.filterables[name]) { return; }
                            
                                const hits = this.state.filterables[name];
                            
                            

                              Function search has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                search (query: any) {
                                  const setSuggestions = (suggestions: any, callback?: any) => {
                                    const showSuggestions = suggestions.length > 0;
                                    this.setState({ suggestions, selectedSuggestionIndex: -1, showSuggestions }, callback);
                                  };

                                Function apiCall has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  apiCall (action: any, options: any) {
                                    const basePath = "/api/v1/bookmarks";
                                    const { onSuccess } = options;
                                    let { bookmark, data } = options;
                                
                                
                                Severity: Minor
                                Found in rails/react-components/src/library/components/bookmarks/edit.tsx - About 1 hr to fix

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

                                          "contains": markFunction(function( text ) {
                                              return function( elem ) {
                                                  return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
                                              };
                                          }),
                                  Severity: Major
                                  Found in rails/app/assets/javascripts/jquery/jquery.js and 1 other location - About 1 hr to fix
                                  rails/app/assets/javascripts/prototype.js on lines 5593..5597

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

                                  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 ( jQuery.isFunction( value ) ) {
                                              return this.each(function( j ) {
                                                  jQuery( this ).removeClass( value.call(this, j, this.className) );
                                              });
                                          }
                                  Severity: Major
                                  Found in rails/app/assets/javascripts/jquery/jquery.js and 1 other location - About 1 hr to fix
                                  rails/app/assets/javascripts/jquery/jquery.js on lines 2032..2036

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

                                  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 ( jQuery.isFunction( value ) ) {
                                              return this.each(function( j ) {
                                                  jQuery( this ).addClass( value.call(this, j, this.className) );
                                              });
                                          }
                                  Severity: Major
                                  Found in rails/app/assets/javascripts/jquery/jquery.js and 1 other location - About 1 hr to fix
                                  rails/app/assets/javascripts/jquery/jquery.js on lines 2068..2072

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

                                  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

                                        "contains": markFunction(function( text ) {
                                          return function( elem ) {
                                            return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
                                          };
                                        }),
                                  Severity: Major
                                  Found in rails/app/assets/javascripts/prototype.js and 1 other location - About 1 hr to fix
                                  rails/app/assets/javascripts/jquery/jquery.js on lines 4428..4432

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

                                  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