concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

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

            { data.preview_url != null
              ? <a className="mb-edit" href={data.preview_url} title="Preview this activity" target="_blank" rel="noopener noreferrer">Preview</a>
              : undefined }
rails/react-components/src/library/components/materials-bin/material.tsx on lines 63..65
rails/react-components/src/library/components/materials-bin/material.tsx on lines 66..68
rails/react-components/src/library/components/materials-bin/material.tsx on lines 72..74

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

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

                  <tr>
                    <td colSpan={3} className={css.studentsTableRow}>
                      <StudentsTable classId={classInfo.id} currentSelectedProject={currentSelectedProject} />
                    </td>
                  </tr>
rails/react-components/src/library/components/permission-forms/students-tab/students-tab.tsx on lines 122..126

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

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 (document.getElementById("pprfl")) {
      document.getElementById("pprfl")?.addEventListener("scroll", this.handleLightboxScroll);
    } else {
      document.addEventListener("scroll", this.handlePageScroll);
    }
rails/react-components/src/library/components/stem-finder.tsx on lines 233..237

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

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

        <a href={previewUrl} target="_blank" className={commonCss.smallButton} title="Preview" onClick={() => logEvent(previewLogData)} rel="noreferrer">Preview</a>
rails/react-components/src/library/components/common/offering-buttons.tsx on lines 43..43

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

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

        <label>
          <div>{ label }</div>
          <input
            type="date"
            name={name}
rails/react-components/src/library/components/user-report-form/index.tsx on lines 211..219

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

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

function import_job_status(){
    var targetUrl = "/import/imports/import_activity_progress";
    var timer;

    timer = setInterval(function(){
Severity: Minor
Found in rails/app/assets/javascripts/import_progress.js - About 1 hr to fix

    Function update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      update: function(newDate) {
        this.updateDaysRow();
        this.date = newDate;
        var today = new Date();
        this.headerSpan.innerHTML = UI.Calendar.Options.MONTHS[this.date.getMonth()] + ' ' + this.date.getFullYear();
    Severity: Minor
    Found in rails/public/javascripts/light_box.js - About 1 hr to fix

      Function Selector has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Prototype.Selector = (function() {
      
        function select() {
          throw new Error('Method "Prototype.Selector.select" must be defined.');
        }
      Severity: Minor
      Found in rails/app/assets/javascripts/prototype.js - About 1 hr to fix

        Function promise has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        jQuery.ready.promise = function( obj ) {
            if ( !readyList ) {
        
                readyList = jQuery.Deferred();
        
        
        Severity: Minor
        Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

          Function html has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              html: function( value ) {
                  return jQuery.access( this, function( value ) {
                      var elem = this[0] || {},
                          i = 0,
                          l = this.length;
          Severity: Minor
          Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

            Function expandcollapseoptions has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function expandcollapseoptions(id,material_type,btn_type){
                if((material_type+id+btn_type)!=expandedShareButtonid)
                {
                    $$(".Expand_Collapse").each(function(shareContainer){shareContainer.hide();shareContainer.removeClassName('visible');});
                    $$(".Expand_Collapse_Link").each(function(sharebtn){
            Severity: Minor
            Found in rails/app/assets/javascripts/share_material.js - About 1 hr to fix

              Function update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                update: function(newDate) {
                  this.updateDaysRow();
                  this.date = newDate;
                  var today = new Date();
                  this.headerSpan.innerHTML = UI.Calendar.Options.MONTHS[this.date.getMonth()] + ' ' + this.date.getFullYear();
              Severity: Minor
              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

                Method get_notices_for_user has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def self.get_notices_for_user(user)
                    notices_hash = {
                      :notices => [],
                      :notice_display => '',
                      :notice_display_type => self.NOTICE_DISPLAY_TYPES[:no_notice]
                Severity: Minor
                Found in rails/app/models/admin/site_notice.rb - About 1 hr to fix

                  Function updateDrag has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    updateDrag: function(event, pointer) {
                      if(!this.dragging) this.startDrag(event);
                  
                      if(!this.options.quiet){
                        Position.prepare();
                  Severity: Minor
                  Found in rails/app/assets/javascripts/dragdrop.js - About 1 hr to fix

                    Method login_line has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def login_line(options = {})
                        opts = {
                          :welcome  => "Welcome",
                          :login => "Login",
                          :signup => "Sign up",
                    Severity: Minor
                    Found in rails/app/helpers/application_helper.rb - About 1 hr to fix

                      Method bulk_update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def bulk_update
                          class_id = params[:class_id]
                          student_ids = params[:student_ids]
                          add_permission_form_ids = params[:add_permission_form_ids] || []
                          remove_permission_form_ids = params[:remove_permission_form_ids] || []
                      Severity: Minor
                      Found in rails/app/controllers/api/v1/permission_forms_controller.rb - About 1 hr to fix

                        Method create has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def create
                            authorize Interactive
                            @interactive = Interactive.new(interactive_strong_params(params[:interactive]))
                            @interactive.user = current_visitor
                        
                        
                        Severity: Minor
                        Found in rails/app/controllers/interactives_controller.rb - About 1 hr to fix

                          Method update_class_and_teachers has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def update_class_and_teachers(portal_clazz, object_params)
                              updated_class = portal_clazz.update(portal_clazz_strong_params(object_params))
                              if updated_class
                                class_name_changed = portal_clazz.saved_change_to_attribute?(:name)
                          
                          
                          Severity: Minor
                          Found in rails/app/controllers/portal/clazzes_controller.rb - About 1 hr to fix

                            Method security_question has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def security_question(number)
                                result = <<-EOF
                                <div class = 'f-row'>
                                  <ui-select ng-model="regCtrl.questions[#{number}]"
                                    name="questions[#{number}]"  theme="select2"
                            Severity: Minor
                            Found in rails/app/helpers/signup_helper.rb - About 1 hr to fix

                              Method down has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def down
                                  create_table "resource_pages", :force => true do |t|
                                    t.integer  "user_id"
                                    t.string   "name"
                                    t.text     "description"
                              Severity: Minor
                              Found in rails/db/migrate/20160123000348_remove_resource_pages.rb - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language