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

    const includedActivities = activities.map(function (activity: any, index: number) {
      return (
        <span key={index}>
          <em>
            { activity.name }
rails/react-components/src/library/components/resource-lightbox.tsx on lines 212..221

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

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

    const includedActivities = activities.map(function (activity: any, index: any) {
      return (
        <span key={index}>
          <em>
            { activity.name }
rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 122..131

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

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

  @Authorized()
  @Query(() => PortalPermissionForm)
  PortalPermissionForm(@Arg("id") id: string) {
    return PortalPermissionForm.findOne({ where: { id }, relations: ["project"]});
  }
admin-panel/graphql-backend/src/resolvers/PortalStudentResolver.ts on lines 59..63
admin-panel/graphql-backend/src/resolvers/UserResolver.ts on lines 76..80

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

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

    parseCss: function( css ) {
        var w = {},
            s = {},
            c = {},
            active = false,
Severity: Minor
Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

    Function Sizzle has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Sizzle( selector, context, results, seed ) {
        results = results || [];
        context = context || document;
        var match, elem, xml, m,
            nodeType = context.nodeType;
    Severity: Minor
    Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

      Function val has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          val: function( value ) {
              var hooks, ret, isFunction,
                  elem = this[0];
      
              if ( !arguments.length ) {
      Severity: Minor
      Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

        Function setOptions has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          setOptions: function(options) {
            this.options = Object.extend({
              choices: 10,
              partialSearch: true,
              partialChars: 2,
        Severity: Minor
        Found in rails/app/assets/javascripts/controls.js - About 1 hr to fix

          Function drawHit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              drawHit: function(n){
                  var octx = this.octx,
                      s = n.series,
                      tHoz = this.tHoz.bind(this),
                      tVert = this.tVert.bind(this);
          Severity: Minor
          Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 1 hr to fix

            Function drawHit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                drawHit: function(n){
                    var octx = this.octx,
                        s = n.series,
                        tHoz = this.tHoz.bind(this),
                        tVert = this.tVert.bind(this);
            Severity: Minor
            Found in rails/app/assets/javascripts/flotr/flotr.js - About 1 hr to fix

              Method elastic_search_learner_model has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def elastic_search_learner_model
                  {
                    learner_id: self.id,
                    report_learner_id: self.report_learner_only_id.id,
                    student_id: self.student.id,
              Severity: Minor
              Found in rails/app/models/portal/learner.rb - About 1 hr to fix

                Method show has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def show
                    @offering = Portal::Offering.find(params[:id])
                    authorize @offering
                
                    respond_to do |format|
                Severity: Minor
                Found in rails/app/controllers/portal/offerings_controller.rb - About 1 hr to fix

                  Method update has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def update
                      cancel = params[:commit] == "Cancel"
                      @interactive = Interactive.find(params[:id])
                      authorize @interactive
                  
                  
                  Severity: Minor
                  Found in rails/app/controllers/interactives_controller.rb - About 1 hr to fix

                    Method update has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def update
                        cancel = params[:commit] == "Cancel"
                        @external_activity = ExternalActivity.find(params[:id])
                        authorize @external_activity
                    
                    
                    Severity: Minor
                    Found in rails/app/controllers/external_activities_controller.rb - About 1 hr to fix

                      Function renderForm has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        renderForm () {
                          const { externalReports } = this.props;
                          const { queryParams, externalReportButtonDisabled } = this.state;
                          // ...LEARNER_QUERY is the renamed ...REPORT_QUERY, use a fallback to wait for the portal to update
                          const learnerQueryUrl = Portal.API_V1.EXTERNAL_RESEARCHER_REPORT_LEARNER_QUERY || Portal.API_V1.EXTERNAL_RESEARCHER_REPORT_QUERY;

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

                          render () {
                            const { needMoreTeachers } = this.state;
                            const { currentTeachers, unassignedTeachers } = this.state;
                        
                            return (

                          Function positionBgImage has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              positionBgImage: function( shape, index ) {
                                  var me = this;
                                  PIE.Util.withImageSize( shape.fill.src, function( size ) {
                                      var el = me.targetElement,
                                          bounds = me.boundsInfo.getBounds(),
                          Severity: Minor
                          Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

                            Function stop has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                stop: function( type, clearQueue, gotoEnd ) {
                                    var stopQueue = function( hooks ) {
                                        var stop = hooks.stop;
                                        delete hooks.stop;
                                        stop( gotoEnd );
                            Severity: Minor
                            Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

                              Function on has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
                                      var origFn, type;
                              
                                      // Types can be a map of types/handlers
                                      if ( typeof types === "object" ) {
                              Severity: Minor
                              Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

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

                                jQuery.extend = jQuery.fn.extend = function() {
                                    var options, name, src, copy, copyIsArray, clone,
                                        target = arguments[0] || {},
                                        i = 1,
                                        length = arguments.length,
                                Severity: Minor
                                Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

                                  Function set_up_html has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      Chosen.prototype.set_up_html = function() {
                                        var container_classes, container_props;
                                        container_classes = ["chosen-container"];
                                        container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
                                        if (this.inherit_select_classes && this.form_field.className) {
                                  Severity: Minor
                                  Found in rails/app/assets/javascripts/chosen.proto.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language