concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

Function calculateSpacing has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    calculateSpacing: function(){
        var a = this.axes,
              options = this.options,
              series = this.series,
              margin = options.grid.labelMargin,
Severity: Major
Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 2 hrs to fix

    Function calculateSpacing has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        calculateSpacing: function(){
            var a = this.axes,
                  options = this.options,
                  series = this.series,
                  margin = options.grid.labelMargin,
    Severity: Major
    Found in rails/app/assets/javascripts/flotr/flotr.js - About 2 hrs to fix

      Function _getColumns has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _getColumns () {
          const columns: any = [];
          // Adds all elements of `array` to column `columnIdx` and marks them as `visible`.
          // Note that the array is @params.materials at the beginning and then its child elements recursively.
          const fillColumns = (array: any, columnIdx?: any, visible?: any) => {

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

          render () {
            let border, favClassMap, favDiv, outlineDiv;
            const { material, configuration } = this.props;
            const { icon } = material;
            const starred = material.is_favorite;

          Function componentDidMount has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            componentDidMount () {
              if (this.props.info.total_pages < 2) {
                // don't display pagination if there's only 1 page
                return;
              }
          Severity: Major
          Found in rails/react-components/src/library/components/search/pagination.tsx - About 2 hrs to fix

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

              render () {
                const { resource, index, opacity } = this.props;
                const resourceTypeClass = resource.material_type.toLowerCase();
                const finderResultClasses = this.state.isOpen ? `resourceItem ${css.finderResult} ${css.open} ${css[resourceTypeClass]}` : `resourceItem ${css.finderResult} ${css[resourceTypeClass]}`;
                const resourceName = resource.name;
            Severity: Major
            Found in rails/react-components/src/library/components/stem-finder-result.tsx - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                                      if( ( val.charAt(0) === 'r' ? isNumOrPct( next() ) : isNum( next() ) ) &&
                                          isValue( next(), ',' ) &&
                                          isNumOrPct( next() ) &&
                                          isValue( next(), ',' ) &&
                                          isNumOrPct( next() ) &&
              Severity: Critical
              Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 2 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                                if ( ( mappedTypes || origType === handleObj.origType ) &&
                                     ( !handler || handler.guid === handleObj.guid ) &&
                                     ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
                                     ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
                                    eventType.splice( j--, 1 );
                Severity: Critical
                Found in rails/app/assets/javascripts/jquery/jquery.js - About 2 hrs to fix

                  Function clonePosition has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function clonePosition(element, source, options) {
                      options = Object.extend({
                        setLeft:    true,
                        setTop:     true,
                        setWidth:   true,
                  Severity: Minor
                  Found in rails/app/assets/javascripts/prototype.js - About 2 hrs to fix

                    Consider simplifying this complex logical expression.
                    Open

                        if ( args.length === 1 && typeof first === "string" && first.length < 512 && context === document &&
                            first.charAt(0) === "<" && !rnocache.test( first ) &&
                            (jQuery.support.checkClone || !rchecked.test( first )) &&
                            (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
                    
                    
                    Severity: Critical
                    Found in rails/app/assets/javascripts/jquery/jquery.js - About 2 hrs to fix

                      Function init has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          init: function( selector, context, rootjQuery ) {
                              var match, elem, ret, doc;
                      
                              // Handle $(""), $(null), $(undefined), $(false)
                              if ( !selector ) {
                      Severity: Minor
                      Found in rails/app/assets/javascripts/jquery/jquery.js - About 2 hrs to fix

                        Function initialize has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          initialize: function(element) {
                            var defaults = {
                              handle: false,
                              reverteffect: function(element, top_offset, left_offset) {
                                var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;
                        Severity: Minor
                        Found in rails/app/assets/javascripts/dragdrop.js - About 2 hrs to fix

                          Method get_standard_statements has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def get_standard_statements
                          
                              key                     = ENV['ASN_API_KEY']
                              document_id             = params[:asn_document_id]
                              statement_notation_q    = params[:asn_statement_notation_query]
                          Severity: Minor
                          Found in rails/app/controllers/api/v1/materials_controller.rb - About 2 hrs to fix

                            Method external_report_query has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def external_report_query
                                authorize [:api, :v1, :report_user]
                            
                                teacher_ids = []
                                if params[:teachers] && !params[:teachers].empty?
                            Severity: Minor
                            Found in rails/app/controllers/api/v1/report_users_controller.rb - About 2 hrs to fix

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

                                def update
                                  if params[:commit] == "Cancel"
                                    redirect_to view_context.class_link_for_user
                                  else
                                    @user = User.find(params[:id])
                              Severity: Minor
                              Found in rails/app/controllers/users_controller.rb - About 2 hrs to fix

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

                                  enable: function() {
                                    this.set.links.each(function(item) {
                                      if (item.url != this.url) return;
                                      item.tag.removeClassName('disabled');
                                    }.bind(this));
                                rails/app/assets/javascripts/active_scaffold/default/active_scaffold.js on lines 389..394

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

                                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

                                  _cacheObserverCallbacks: function() {
                                    ['onStart','onEnd','onDrag'].each( function(eventName) {
                                      Draggables[eventName+'Count'] = Draggables.observers.select(
                                        function(o) { return o[eventName]; }
                                      ).length;
                                Severity: Major
                                Found in rails/app/assets/javascripts/dragdrop.js and 1 other location - About 2 hrs to fix
                                rails/app/assets/javascripts/livepipe/resizable.js on lines 87..93

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

                                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

                                    _cacheObserverCallbacks: function() {
                                        ['onStart','onEnd','onResize'].each( function(eventName) {
                                            Resizables[eventName+'Count'] = Resizables.observers.select(
                                                function(o) { return o[eventName]; }
                                            ).length;
                                Severity: Major
                                Found in rails/app/assets/javascripts/livepipe/resizable.js and 1 other location - About 2 hrs to fix
                                rails/app/assets/javascripts/dragdrop.js on lines 215..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 75.

                                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

                                  disable: function() {
                                    this.set.links.each(function(item) {
                                      if (item.url != this.url) return;
                                      item.tag.addClassName('disabled');
                                    }.bind(this));
                                rails/app/assets/javascripts/active_scaffold/default/active_scaffold.js on lines 382..387

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

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

                                        { links.rubric_doc ? <a className="portal-pages-secondary-button" href={links.rubric_doc.url} target="_blank" onClick={this.handleRubricDocClick} rel="noreferrer">{ links.rubric_doc.text }</a> : null }
                                rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 212..212
                                rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 214..214
                                rails/react-components/src/library/components/resource-lightbox.tsx on lines 395..395
                                rails/react-components/src/library/components/resource-lightbox.tsx on lines 399..399

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

                                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