concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

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

  handleTeacherGuideClick (e: any) {
    const resource = this.state.resource;
    gtag("event", "click", {
      "category": "Teacher Guide Link",
      "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 63..69
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 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

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

  handleAddToCollectionClick (e: any) {
    const resource = this.state.resource;
    gtag("event", "click", {
      "category": "Add to Collection 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 63..69
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

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

  handleRubricDocClick (e: any) {
    const resource = this.state.resource;
    gtag("event", "click", {
      "category": "Browse Page - Rubric Doc Link",
      "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 63..69
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 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

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

  handleTeacherEditionClick (e: any) {
    const resource = this.state.resource;
    gtag("event", "click", {
      "category": "Resource Teacher Edition 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 63..69
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 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

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

  handleTeacherResourcesClick (e: any) {
    const resource = this.state.resource;
    gtag("event", "click", {
      "category": "Resource Teacher Resources 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 63..69
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 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

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

  handleTeacherGuideClick (e: any) {
    const resource = this.state.resource;
    gtag("event", "click", {
      "category": "Browse Page - Teacher Guide Link",
      "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 63..69
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

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

  handlePreviewClick (e: any) {
    const resource = this.state.resource;
    gtag("event", "click", {
      "category": "Resource Preview 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 63..69
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 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

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

  handleRubricDocClick (e: any) {
    const resource = this.state.resource;
    gtag("event", "click", {
      "category": "Rubric Doc Link",
      "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 63..69
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 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

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

  handlePreviewClick (e: any) {
    const resource = this.state.resource;
    gtag("event", "click", {
      "category": "Browse Page - Resource Preview Button",
      "resource": resource.name
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 63..69
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

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

  handleTeacherResourcesClick (e: any) {
    const resource = this.state.resource;
    gtag("event", "click", {
      "category": "browse page - resource teacher resources 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 63..69
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

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

  handleAddToCollectionClick (e: any) {
    const resource = this.state.resource;
    gtag("event", "click", {
      "category": "Browse Page - Add to Collection 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 63..69
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/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

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

  handleTeacherEditionClick (e: any) {
    const resource = this.state.resource;
    gtag("event", "click", {
      "category": "Browse Page - Resource Teacher Edition 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 55..61
rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 63..69
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

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

  handleAssignClick (e: any) {
    const resource = this.state.resource;
    gtag("event", "click", {
      "category": "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 63..69
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 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

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

      this.apiCall("delete", { bookmark })
        .catch(err => {
          // add the bookmark back on error
          bookmarks.splice(index, 0, bookmark);
          this.setState({ bookmarks });
rails/react-components/src/library/components/materials-collection/edit-list.tsx on lines 23..29

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

  @Field(() => String,{nullable: true})
  @Column("varchar", {
    name: "project_card_description",
    nullable: true,
    length: 255,
Severity: Minor
Found in admin-panel/graphql-backend/src/entities/AdminProjects.ts and 1 other location - About 50 mins to fix
admin-panel/graphql-backend/src/entities/AdminProjects.ts on lines 42..48

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

  @Field(() => String,{nullable: true})
  @Column("varchar", {
    name: "project_card_image_url",
    nullable: true,
    length: 255,
Severity: Minor
Found in admin-panel/graphql-backend/src/entities/AdminProjects.ts and 1 other location - About 50 mins to fix
admin-panel/graphql-backend/src/entities/AdminProjects.ts on lines 50..56

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

      this.apiCall("remove_material", { data: { item_id: item.id } })
        .catch(err => {
          // add back on error
          items.splice(index, 0, item);
          this.setState({ items });
rails/react-components/src/library/components/bookmarks/edit.tsx on lines 62..68

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

  def up
      add_column :saveable_external_link_urls, :has_been_reviewed, :boolean, :default => false
      add_column :saveable_image_question_answers, :has_been_reviewed, :boolean, :default => false
      add_column :saveable_multiple_choice_answers, :has_been_reviewed, :boolean, :default => false
      add_column :saveable_open_response_answers, :has_been_reviewed, :boolean, :default => false
rails/db/migrate/20160307140202_add_has_been_reviewed_to_savables.rb on lines 14..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 42.

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

    respond_to do |format|
      if @materials_collection.update(materials_collection_strong_params(params[:materials_collection]))
        format.html { redirect_to @materials_collection, notice: 'Materials Collection was successfully updated.' }
        format.json { head :no_content }
      else
Severity: Minor
Found in rails/app/controllers/materials_collections_controller.rb and 1 other location - About 50 mins to fix
rails/app/controllers/admin/authoring_sites_controller.rb on lines 67..73

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

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

    respond_to do |format|
      if @admin_authoring_site.update(admin_authoring_site_strong_params(params[:admin_authoring_site]))
        format.html { redirect_to @admin_authoring_site, notice: 'Authoring site was successfully updated.' }
        format.json { head :no_content }
      else
Severity: Minor
Found in rails/app/controllers/admin/authoring_sites_controller.rb and 1 other location - About 50 mins to fix
rails/app/controllers/materials_collections_controller.rb on lines 63..69

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

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