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

@Index("index_admin_site_notice_roles_on_notice_id", ["noticeId"], {})
@Index("index_admin_site_notice_roles_on_role_id", ["roleId"], {})
@Entity("admin_site_notice_roles", { schema: "portal_development" })
export class AdminSiteNoticeRoles {
  @PrimaryGeneratedColumn({ type: "int", name: "id" })
admin-panel/graphql-backend/src/entities/unused/PortalBookmarkVisits.ts on lines 3..19
admin-panel/graphql-backend/src/entities/unused/PortalCollaborationMemberships.ts on lines 3..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 137.

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

@Entity("portal_bookmark_visits", { schema: "portal_development" })
export class PortalBookmarkVisits {
  @PrimaryGeneratedColumn({ type: "int", name: "id" })
  id: number;

admin-panel/graphql-backend/src/entities/unused/AdminSiteNoticeRoles.ts on lines 3..21
admin-panel/graphql-backend/src/entities/unused/PortalCollaborationMemberships.ts on lines 3..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 137.

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 Serializers has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

Form.Element.Serializers = (function() {
  function input(element, value) {
    switch (element.type.toLowerCase()) {
      case 'checkbox':
      case 'radio':
Severity: Minor
Found in rails/app/assets/javascripts/prototype.js - About 5 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function extendYRangeIfNeededByBar has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    extendYRangeIfNeededByBar: function(axis){
        if(axis.options.max == null){
            var newmax = axis.max,
                  i, s, b, c,
                  stackedSums = {},
Severity: Minor
Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 5 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function extendYRangeIfNeededByBar has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    extendYRangeIfNeededByBar: function(axis){
        if(axis.options.max == null){
            var newmax = axis.max,
                  i, s, b, c,
                  stackedSums = {},
Severity: Minor
Found in rails/app/assets/javascripts/flotr/flotr.js - About 5 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

  contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) {
    var oldPath = this.currentPath_;
    this.beginPath();

    this.moveTo(aX, aY);
Severity: Major
Found in rails/app/assets/javascripts/flotr/excanvas.js and 1 other location - About 5 hrs to fix
rails/app/assets/javascripts/flotr/excanvas.js on lines 442..454

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

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

  contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) {
    var oldPath = this.currentPath_;
    this.beginPath();

    this.moveTo(aX, aY);
Severity: Major
Found in rails/app/assets/javascripts/flotr/excanvas.js and 1 other location - About 5 hrs to fix
rails/app/assets/javascripts/flotr/excanvas.js on lines 428..440

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

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

  var turn_off = function(toggle_element,duration) {
    toggle_element.addClassName(closed_class);
    toggle_element.removeClassName(open_class);
    var show_hider = $(toggle_element).down("." + show_hide_class);
    if (show_hider) {
Severity: Major
Found in rails/app/assets/javascripts/accordion.js and 1 other location - About 5 hrs to fix
rails/app/assets/javascripts/accordion.js on lines 16..25

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

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

  var turn_on = function(toggle_element,duration) {
    toggle_element.addClassName(open_class);
    toggle_element.removeClassName(closed_class);
    var show_hider = $(toggle_element).down("." + show_hide_class);
    if (show_hider) {
Severity: Major
Found in rails/app/assets/javascripts/accordion.js and 1 other location - About 5 hrs to fix
rails/app/assets/javascripts/accordion.js on lines 27..36

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

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

Window has 38 functions (exceeds 20 allowed). Consider refactoring.
Open

UI.Window = Class.create(UI.Options, {
  // Group: Options
  options: {

    // Property: theme
Severity: Minor
Found in rails/public/javascripts/light_box.js - About 5 hrs to fix

    Consider simplifying this complex logical expression.
    Open

                if ( event.pageX == null && original.clientX != null ) {
                    eventDoc = event.target.ownerDocument || document;
                    doc = eventDoc.documentElement;
                    body = eventDoc.body;
    
    
    Severity: Critical
    Found in rails/app/assets/javascripts/jquery/jquery.js - About 5 hrs to fix

      Function Callbacks has 125 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      jQuery.Callbacks = function( options ) {
      
          // Convert options from String-formatted to Object-formatted if needed
          // (we check in cache first)
          options = typeof options === "string" ?
      Severity: Major
      Found in rails/app/assets/javascripts/jquery/jquery.js - About 5 hrs to fix

        Window has 38 functions (exceeds 20 allowed). Consider refactoring.
        Open

        UI.Window = Class.create(UI.Options, {
          // Group: Options
          options: {
        
            // Property: theme
        Severity: Minor
        Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 5 hrs to fix

          Window has 38 functions (exceeds 20 allowed). Consider refactoring.
          Open

          UI.Window = Class.create(UI.Options, {
            // Group: Options
            options: {
          
              // Property: theme
          Severity: Minor
          Found in rails/app/assets/javascripts/livepipe/window.js - About 5 hrs to fix

            File data_helpers.rb has 375 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module Materials
              module DataHelpers
                # This module expects to be included into a controller, so that view_context resolves
                # to something that provides all the various view helpers.
                # Note that this module will be dealing only with ExternalActivity instances. In the past, it used to handle
            Severity: Minor
            Found in rails/lib/materials/data_helpers.rb - About 5 hrs to fix

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

                resetOverflow: function() {
                  var container = this.container;
                  // Restore overflow ans scrolloffset
                  if (container.savedOverflow) {
                    if (this.container == document.body && Prototype.Browser.IE)
              Severity: Major
              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 5 hrs to fix
              rails/app/assets/javascripts/livepipe/window.js on lines 2816..2828
              rails/public/javascripts/light_box.js on lines 4782..4794

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

              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

                setPosition: function(top, left) {
                  var pos = this.computePosition(top, left);
                  this.options.top  = pos.top;
                  this.options.left = pos.left;
              
              
              Severity: Major
              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 5 hrs to fix
              rails/app/assets/javascripts/livepipe/window.js on lines 1832..1843
              rails/public/javascripts/light_box.js on lines 3589..3600

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

              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

                resetOverflow: function() {
                  var container = this.container;
                  // Restore overflow ans scrolloffset
                  if (container.savedOverflow) {
                    if (this.container == document.body && Prototype.Browser.IE)
              Severity: Major
              Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 5 hrs to fix
              rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4782..4794
              rails/public/javascripts/light_box.js on lines 4782..4794

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

              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

                resetOverflow: function() {
                  var container = this.container;
                  // Restore overflow ans scrolloffset
                  if (container.savedOverflow) {
                    if (this.container == document.body && Prototype.Browser.IE)
              Severity: Major
              Found in rails/public/javascripts/light_box.js and 2 other locations - About 5 hrs to fix
              rails/app/assets/javascripts/livepipe/window.js on lines 2816..2828
              rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4782..4794

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

              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

                setPosition: function(top, left) {
                  var pos = this.computePosition(top, left);
                  this.options.top  = pos.top;
                  this.options.left = pos.left;
              
              
              Severity: Major
              Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 5 hrs to fix
              rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3589..3600
              rails/public/javascripts/light_box.js on lines 3589..3600

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

              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