concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

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

  adapt: function() {
    var dimensions = this.content.getScrollDimensions();
    if (this.options.superflousEffects)
      this.morph(dimensions, true);
    else
Severity: Major
Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 2 hrs to fix
rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3430..3437
rails/public/javascripts/light_box.js on lines 3430..3437

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

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

  adapt: function() {
    var dimensions = this.content.getScrollDimensions();
    if (this.options.superflousEffects)
      this.morph(dimensions, true);
    else
Severity: Major
Found in rails/public/javascripts/light_box.js and 2 other locations - About 2 hrs to fix
rails/app/assets/javascripts/livepipe/window.js on lines 1682..1689
rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3430..3437

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

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

  setTheme: function(theme) {
    this.stack.windows.select(function(w) {
      return !w.options.theme;
    }).invoke('setTheme', theme, true);
    this.options.theme = theme;
Severity: Major
Found in rails/public/javascripts/light_box.js and 2 other locations - About 2 hrs to fix
rails/app/assets/javascripts/livepipe/window.js on lines 2651..2657
rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4611..4617

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

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

  setTheme: function(theme) {
    this.stack.windows.select(function(w) {
      return !w.options.theme;
    }).invoke('setTheme', theme, true);
    this.options.theme = theme;
Severity: Major
Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 2 hrs to fix
rails/app/assets/javascripts/livepipe/window.js on lines 2651..2657
rails/public/javascripts/light_box.js on lines 4611..4617

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

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

@ArgsType()
class PageSortQueryArgs {
  @Field(type => Int)
  page: number;

admin-panel/graphql-backend/src/resolvers/PortalStudentPermissionFormResolver.ts on lines 28..41

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

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

@ArgsType()
  class PageSortQueryArgs {
  @Field(type => Int)
  page: number;

admin-panel/graphql-backend/src/resolvers/AdminProjectUserResolver.ts on lines 34..47

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

File external_activities_controller.rb has 257 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class ExternalActivitiesController < ApplicationController

  private

  def pundit_user_not_authorized(exception)
Severity: Minor
Found in rails/app/controllers/external_activities_controller.rb - About 2 hrs to fix

    dhtmlHistory has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    window.dhtmlHistory = {
           
           /*Public: User-agent booleans*/
           isIE: false,
           isOpera: false,
    Severity: Minor
    Found in rails/app/assets/javascripts/active_scaffold/default/dhtml_history.js - About 2 hrs to fix

      Class Teacher has 21 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class Portal::Teacher < ApplicationRecord
        include Cohorts
      
        self.table_name = :portal_teachers
      
      
      Severity: Minor
      Found in rails/app/models/portal/teacher.rb - About 2 hrs to fix

        Class ExternalActivitiesController has 21 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class ExternalActivitiesController < ApplicationController
        
          private
        
          def pundit_user_not_authorized(exception)
        Severity: Minor
        Found in rails/app/controllers/external_activities_controller.rb - About 2 hrs to fix

          Class UserPolicy has 21 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class UserPolicy < ApplicationPolicy
          
            class Scope < Scope
              def resolve
                if user.has_role?('admin','manager')
          Severity: Minor
          Found in rails/app/policies/user_policy.rb - About 2 hrs to fix

            Method clazz_links_for_teacher has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def clazz_links_for_teacher
                clazzes = current_visitor.portal_teacher.clazzes.where(is_archived: false)
                clazz_links = [
                  {
                    id: "/classes",
            Severity: Major
            Found in rails/app/helpers/navigation_helper.rb - About 2 hrs to fix

              Method sitemap has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def sitemap
              
                  builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
              
                      xml.urlset('xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9') {
              Severity: Major
              Found in rails/app/controllers/robots_controller.rb - About 2 hrs to fix

                Function renderLinks has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  renderLinks () {
                    const { resource } = this.props;
                    const isCollection = resource.material_type === "Collection";
                    const isAssignWrapped = window.self !== window.top &&
                      window.self.location.hostname === window.top?.location.hostname;
                Severity: Major
                Found in rails/react-components/src/library/components/stem-finder-result.tsx - About 2 hrs to fix

                  Function FormSerializer has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function FormSerializer(helper) {
                  
                      // private variables
                      var data     = {},
                          pushes   = {};
                  Severity: Major
                  Found in rails/app/assets/javascripts/jquery.serialize-object.js - About 2 hrs to fix

                    Function winnow_results has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        AbstractChosen.prototype.winnow_results = function() {
                          var escapedSearchText, option, regex, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
                          this.no_results_clear();
                          results = 0;
                          searchText = this.get_search_text();
                    Severity: Major
                    Found in rails/app/assets/javascripts/chosen.proto.js - About 2 hrs to fix

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

                            if (isNaN(i)) {
                              i = 0;
                            } else if (i !== 0 && isFinite(i)) {
                              i = (i > 0 ? 1 : -1) * Math.floor(Math.abs(i));
                            }
                      Severity: Major
                      Found in rails/app/assets/javascripts/prototype.js and 1 other location - About 2 hrs to fix
                      rails/app/assets/javascripts/prototype.js on lines 1202..1206

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

                      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

                            'right': function(element) {
                              var parent = hasLayout(element.getOffsetParent());
                              var rect = element.getBoundingClientRect(),
                                pRect = parent.getBoundingClientRect();
                      
                      
                      Severity: Major
                      Found in rails/app/assets/javascripts/prototype.js and 1 other location - About 2 hrs to fix
                      rails/app/assets/javascripts/prototype.js on lines 3959..3965

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

                      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

                                        operator === "$=" ? check && result.slice( -check.length ) === check :
                                          operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
                                            operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
                                              false;
                      Severity: Major
                      Found in rails/app/assets/javascripts/prototype.js and 1 other location - About 2 hrs to fix
                      rails/app/assets/javascripts/jquery/jquery.js on lines 4288..4291

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

                      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

                                          operator === "$=" ? check && result.substr( result.length - check.length ) === check :
                                          operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
                                          operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :
                                          false;
                      Severity: Major
                      Found in rails/app/assets/javascripts/jquery/jquery.js and 1 other location - About 2 hrs to fix
                      rails/app/assets/javascripts/prototype.js on lines 5448..5451

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

                      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