concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

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

  componentDidMount () {
    const { dataUrl, initialData } = this.props;
    if (dataUrl && !initialData) {
      this.getPortalData();
    }
rails/react-components/src/library/components/assigments/index.tsx on lines 100..105
rails/react-components/src/library/components/site-notices/show.tsx on lines 30..35

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

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

  handleSwitchSource (e: any) {
    const { handleNav } = this.state;
    const collectionId = e.target.value;
    handleNav(e, collectionId);
  },
rails/react-components/src/library/components/collection-lightbox.tsx on lines 75..79

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

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

  @Field(() => Boolean)
  @Column("tinyint", {
    name: "is_admin",
    nullable: true,
    width: 1,
Severity: Minor
Found in admin-panel/graphql-backend/src/entities/AdminProjectUsers.ts and 1 other location - About 55 mins to fix
admin-panel/graphql-backend/src/entities/AdminProjectUsers.ts on lines 42..49

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

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

  @Authorized()
  @Mutation(() => PortalPermissionForm)
  async updatePortalPermissionForm(
    @Args()
    params: UpdatePortalPermissionForm) {
admin-panel/graphql-backend/src/resolvers/PortalPermissionFormResolver.ts on lines 75..81

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

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

  def self.up
    create_table :portal_courses do |t|

      t.string    :uuid, :limit => 36
      t.string    :name
Severity: Minor
Found in rails/db/migrate/20090701153601_create_courses.rb and 1 other location - About 55 mins to fix
rails/db/migrate/20090701153603_create_grade_levels.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 44.

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

  def self.up
    create_table :portal_grade_levels do |t|

      t.string    :uuid, :limit => 36
      t.string    :name
Severity: Minor
Found in rails/db/migrate/20090701153603_create_grade_levels.rb and 1 other location - About 55 mins to fix
rails/db/migrate/20090701153601_create_courses.rb on lines 2..20

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

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 getShadowShape has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

        function getShadowShape( index, corner, xOff, yOff, color, blur, path ) {
Severity: Major
Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 50 mins to fix

    Function access has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
    Severity: Major
    Found in rails/app/assets/javascripts/jquery/jquery.js - About 50 mins to fix

      Function plotSlice has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          plotSlice: function(x, y, radius, startAngle, endAngle, fill, vScale) {
      Severity: Major
      Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 50 mins to fix

        Function plotSlice has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            plotSlice: function(x, y, radius, startAngle, endAngle, fill, vScale) {
        Severity: Major
        Found in rails/app/assets/javascripts/flotr/flotr.js - About 50 mins to fix

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

                  if((!this.options.constraint) || (this.options.constraint=='vertical')){
                      style.height = p[1] + "px";
                  }
          Severity: Minor
          Found in rails/app/assets/javascripts/livepipe/resizable.js and 1 other location - About 50 mins to fix
          rails/app/assets/javascripts/livepipe/resizable.js on lines 224..226

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

          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

                      var args,
                          fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
                              Sizzle.error( "unsupported pseudo: " + pseudo );
          Severity: Minor
          Found in rails/app/assets/javascripts/jquery/jquery.js and 1 other location - About 50 mins to fix
          rails/app/assets/javascripts/prototype.js on lines 5533..5535

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

          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

            setBounds: function(bounds, innerSize) {
              return this.setPosition(bounds.top, bounds.left)
                         .setSize(bounds.width, bounds.height, innerSize);
            },
          Severity: Major
          Found in rails/public/javascripts/light_box.js and 2 other locations - About 50 mins to fix
          rails/app/assets/javascripts/livepipe/window.js on lines 1943..1946
          rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3700..3703

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

          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

            setBounds: function(bounds, innerSize) {
              return this.setPosition(bounds.top, bounds.left)
                         .setSize(bounds.width, bounds.height, innerSize);
            },
          Severity: Major
          Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 50 mins to fix
          rails/app/assets/javascripts/livepipe/window.js on lines 1943..1946
          rails/public/javascripts/light_box.js on lines 3700..3703

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

          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((!this.options.constraint) || (this.options.constraint=='horizontal')){
                      style.width = p[0] + "px";
                  }
          Severity: Minor
          Found in rails/app/assets/javascripts/livepipe/resizable.js and 1 other location - About 50 mins to fix
          rails/app/assets/javascripts/livepipe/resizable.js on lines 227..229

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

          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

            setBounds: function(bounds, innerSize) {
              return this.setPosition(bounds.top, bounds.left)
                         .setSize(bounds.width, bounds.height, innerSize);
            },
          Severity: Major
          Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 50 mins to fix
          rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3700..3703
          rails/public/javascripts/light_box.js on lines 3700..3703

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

          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

                  var args,
                    fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
                      Sizzle.error( "unsupported pseudo: " + pseudo );
          Severity: Minor
          Found in rails/app/assets/javascripts/prototype.js and 1 other location - About 50 mins to fix
          rails/app/assets/javascripts/jquery/jquery.js on lines 4360..4362

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

          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[:schools] && !options[:schools].empty?
                if /\A(\d+,*)+\z/.match(options[:schools])
                  schools = options[:schools].split(',').map(&:to_i)
                  filters << {
                    :terms => {
          Severity: Minor
          Found in rails/app/controllers/api/v1/report_learners_es_controller.rb and 1 other location - About 50 mins to fix
          rails/app/controllers/api/v1/report_learners_es_controller.rb on lines 228..243

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

          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[:teachers] && !options[:teachers].empty?
                if /\A(\d+,*)+\z/.match(options[:teachers])
                  teachers = options[:teachers].split(',').map(&:to_i)
                  filters << {
                    :terms => {
          Severity: Minor
          Found in rails/app/controllers/api/v1/report_learners_es_controller.rb and 1 other location - About 50 mins to fix
          rails/app/controllers/api/v1/report_learners_es_controller.rb on lines 208..223

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

          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 14 locations. Consider refactoring.
          Open

            handleAssignClick (e: any) {
              const resource = this.state.resource;
              gtag("event", "click", {
                "category": "Browse Page - Assign to Class Button",
                "resource": resource.name
          rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 39..45
          rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 47..53
          rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 55..61
          rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 71..77
          rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 79..85
          rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 87..93
          rails/react-components/src/library/components/resource-lightbox.tsx on lines 113..119
          rails/react-components/src/library/components/resource-lightbox.tsx on lines 121..127
          rails/react-components/src/library/components/resource-lightbox.tsx on lines 129..135
          rails/react-components/src/library/components/resource-lightbox.tsx on lines 137..143
          rails/react-components/src/library/components/resource-lightbox.tsx on lines 145..151
          rails/react-components/src/library/components/resource-lightbox.tsx on lines 153..159
          rails/react-components/src/library/components/resource-lightbox.tsx on lines 161..167

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

          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