concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

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

  @Query(() => listMeta)
  _allAdminProjectUsersMeta(
    @Args() {filter, page, perPage, sortField, sortOrder}:AdminProjectUserQueryArgs) {
      const where = filter
      const count = AdminProjectUser.count({where})
admin-panel/graphql-backend/src/resolvers/PortalStudentPermissionFormResolver.ts on lines 83..89

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

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

  function Sizzle( selector, context, results, seed ) {
    var match, elem, m, nodeType,
      i, groups, old, nid, newContext, newSelector;

    if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
Severity: Major
Found in rails/app/assets/javascripts/prototype.js - About 3 hrs to fix

    Function Animation has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Animation( elem, properties, options ) {
        var result,
            index = 0,
            tweenerIndex = 0,
            length = animationPrefilters.length,
    Severity: Major
    Found in rails/app/assets/javascripts/jquery/jquery.js - About 3 hrs to fix

      Class ApplicationController has 26 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class ApplicationController < ActionController::Base
        include Clipboard
        include Pundit
      
        protect_from_forgery prepend: false
      Severity: Minor
      Found in rails/app/controllers/application_controller.rb - About 3 hrs to fix

        ResourceLightbox has 26 functions (exceeds 20 allowed). Consider refactoring.
        Open

        const ResourceLightbox = Component({
          getInitialState () {
            const params = ParseQueryString();
            // The parentPage is used to change the URL when the lightbox is closed.
            // If there is a URL parameter with a parentPage it will override any other value.
        Severity: Minor
        Found in rails/react-components/src/library/components/resource-lightbox.tsx - About 3 hrs to fix

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

          UI.Calendar.Options = {
              MONTHS_SHORT: $w('Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'),
              MONTHS: $w('January February March April May June July August September October November December'),
              WEEKDAYS_1CHAR: $w('S M T W T F S'),
              WEEKDAYS_SHORT: $w('Su Mo Tu We Th Fr Sa'),
          Severity: Major
          Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 3 hrs to fix
          rails/public/javascripts/light_box.js on lines 6353..6367

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

          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

          UI.Calendar.Options = {
              MONTHS_SHORT: $w('Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'),
              MONTHS: $w('January February March April May June July August September October November December'),
              WEEKDAYS_1CHAR: $w('S M T W T F S'),
              WEEKDAYS_SHORT: $w('Su Mo Tu We Th Fr Sa'),
          Severity: Major
          Found in rails/public/javascripts/light_box.js and 1 other location - About 3 hrs to fix
          rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 6353..6367

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

          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 (gradeLevelKey) {
                const gradeLevels = filters.gradeLevels;
                for (i = 0; i < gradeLevels.length; i++) {
                  const gradeLevel = gradeLevels[i];
                  if (gradeLevel.key === gradeLevelKey) {
          rails/react-components/src/library/components/stem-finder.tsx on lines 103..112

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

          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 (subjectAreaKey) {
                const subjectAreas = filters.subjectAreas;
                for (i = 0; i < subjectAreas.length; i++) {
                  const subjectArea = subjectAreas[i];
                  if (subjectArea.key === subjectAreaKey) {
          rails/react-components/src/library/components/stem-finder.tsx on lines 117..126

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 95.

          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

            handleOfficialClick = (e: any) => {
              e.currentTarget.classList.toggle(css.selected);
              this.setState((prev) => ({
                hideFeatured: true,
                includeOfficial: !prev.includeOfficial
          rails/react-components/src/library/components/stem-finder.tsx on lines 537..547

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

          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

            handleCommunityClick = (e: any) => {
              e.currentTarget.classList.toggle(css.selected);
              this.setState((prev) => ({
                hideFeatured: true,
                includeContributed: !prev.includeContributed
          rails/react-components/src/library/components/stem-finder.tsx on lines 525..535

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

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          File rico_corner.js has 290 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
            *
            *  Copyright 2005 Sabre Airline Solutions
            *
            *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
          Severity: Minor
          Found in rails/app/assets/javascripts/active_scaffold/default/rico_corner.js - About 2 hrs to fix

            Function extend has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                extend: function(object){
                    object._objectEventSetup = function(event_name){
                        this._observers = this._observers || {};
                        this._observers[event_name] = this._observers[event_name] || [];
                    };
            Severity: Major
            Found in rails/app/assets/javascripts/livepipe/livepipe.js - About 2 hrs to fix

              File jquery.paging.js has 289 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /**
               * @license jQuery paging plugin v1.2.0 23/06/2014
               * http://www.xarg.org/2011/09/jquery-pagination-revised/
               *
               * Copyright (c) 2011, Robert Eisele (robert@xarg.org)
              Severity: Minor
              Found in rails/app/assets/javascripts/jquery.paging.js - About 2 hrs to fix

                File navigation_helper.rb has 289 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module NavigationHelper
                
                  private
                
                  def nav_label(key)
                Severity: Minor
                Found in rails/app/helpers/navigation_helper.rb - About 2 hrs to fix

                  Function render has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render () {
                      const providerComponents = [];
                  
                      if (enableAuthProviders && this.props.oauthProviders) {
                        const providers = this.props.oauthProviders;
                  Severity: Major
                  Found in rails/react-components/src/library/components/signup/login_modal.tsx - About 2 hrs to fix

                    Function draw has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        draw: function(point) {
                            var p = [0,1].map(function(i){ 
                                return (this.size[i] + point[i] - this.pointer[i]);
                            }.bind(this));
                            
                    Severity: Minor
                    Found in rails/app/assets/javascripts/livepipe/resizable.js - About 2 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

                    Method find_call_to_block has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def find_call_to_block(block_name, file_name, line)
                      # line.match("(?<![_\"])#{method}(?![_\"])")
                    
                      if(block_name.start_with?("BASE/"))
                        method = block_name.slice(/BASE\/(.*)/, 1)
                    Severity: Minor
                    Found in rails/script/reference-tree.rb - About 2 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 dropdown_for has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                    var dropdown_for = function(dropDownLinkId,dropDownMenuId) {
                      var dropDownLink = $(dropDownLinkId);
                      var dropDownMenu = $(dropDownMenuId);
                      var dropDownLink_width = dropDownLink.getDimensions().width;
                      var dropDownMenu_width = dropDownMenu.getDimensions().width;
                    Severity: Minor
                    Found in rails/app/assets/javascripts/dropdown.js - About 2 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

                    Method firebase has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def firebase
                        user, learner, teacher = handle_initial_auth
                    
                        raise StandardError, "Missing firebase_app parameter" if params[:firebase_app].blank?
                    
                    
                    Severity: Minor
                    Found in rails/app/controllers/api/v1/jwt_controller.rb - About 2 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

                    Severity
                    Category
                    Status
                    Source
                    Language