concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

WindowManager has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

UI.WindowManager = Class.create(UI.Options, {
  options: {
    container:   null, // will default to document.body
    zIndex:      0,
    theme:       "alphacube",
Severity: Minor
Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 3 hrs to fix

    WindowManager has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

    UI.WindowManager = Class.create(UI.Options, {
      options: {
        container:   null, // will default to document.body
        zIndex:      0,
        theme:       "alphacube",
    Severity: Minor
    Found in rails/app/assets/javascripts/livepipe/window.js - About 3 hrs to fix

      Method perform has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def perform
          import = Import::Import.find(import_id)
          content_hash = JSON.parse(import.upload_data, :symbolize_names => true)
          total_districts_count = content_hash[:districts].size
          total_schools_count = content_hash[:schools].size
      Severity: Major
      Found in rails/app/models/import/import_schools_and_districts.rb - About 3 hrs to fix

        Method firebase has 79 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def firebase
            user, learner, teacher = handle_initial_auth
        
            raise StandardError, "Missing firebase_app parameter" if params[:firebase_app].blank?
        
        
        Severity: Major
        Found in rails/app/controllers/api/v1/jwt_controller.rb - About 3 hrs to fix

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

            createOverlays: function() {
              this.modalOverlay = new Element("div", { style: this.overlayStyle });
              this.dragOverlay  = new Element("div", { style: this.overlayStyle+"height: 100%" });
              this.iframe       = Prototype.Browser.IE ? new UI.IframeShim() : null;
            },
          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 4816..4820

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

          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

            createOverlays: function() {
              this.modalOverlay = new Element("div", { style: this.overlayStyle });
              this.dragOverlay  = new Element("div", { style: this.overlayStyle+"height: 100%" });
              this.iframe       = Prototype.Browser.IE ? new UI.IframeShim() : null;
            },
          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 4816..4820

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

          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

              const teacherResourcesLink = resource.links.teacher_resources && Portal.currentUser.isTeacher
                ? <a href={resource.links.teacher_resources.url} target="_blank" rel="noopener noreferrer" onClick={this.handleTeacherResourcesClick}>{ resource.links.teacher_resources.text }</a>
                : null;
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 266..268
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 272..274

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

          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

              const rubricDocLink = resource.links.rubric_doc && Portal.currentUser.isTeacher
                ? <a href={resource.links.rubric_doc.url} target="_blank" rel="noopener noreferrer" onClick={this.handleRubricDocClick}>{ resource.links.rubric_doc.text }</a>
                : null;
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 266..268
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 269..271

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

          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

              const teacherGuideLink = resource.links.teacher_guide && Portal.currentUser.isTeacher
                ? <a href={resource.links.teacher_guide.url} target="_blank" rel="noopener noreferrer" onClick={this.handleTeacherGuideClick}>{ resource.links.teacher_guide.text }</a>
                : null;
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 269..271
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 272..274

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

          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

                            <div className={css.selectContainer}>
                              Add:
                              <Select<PermissionFormOption, true>
                                classNames={permissionFormsSelectClassNames}
                                className={css.permissionFormSelect}
          rails/react-components/src/library/components/permission-forms/students-tab/students-table.tsx on lines 228..240

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

          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

                            <div className={css.selectContainer}>
                              Remove:
                              <Select<PermissionFormOption, true>
                                classNames={permissionFormsSelectClassNames}
                                className={css.permissionFormSelect}
          rails/react-components/src/library/components/permission-forms/students-tab/students-table.tsx on lines 215..227

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

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

          export default function MBFetchDataHOC (WrappedComponent: any, optionsFn: any) {
            const MBFetchData = createReactClass({
              getInitialState () {
                const state: any = {};
                const { dataStateKey } = optionsFn();

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

                next: function(){
                    this.links.each(function(link,i){
                        if(this.activeLink == link && this.links[i + 1]){
                            this.setActiveTab(this.links[i + 1]);
                            throw $break;
            Severity: Major
            Found in rails/app/assets/javascripts/livepipe/tabs.js and 1 other location - About 3 hrs to fix
            rails/app/assets/javascripts/livepipe/tabs.js on lines 122..129

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

            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

                previous: function(){
                    this.links.each(function(link,i){
                        if(this.activeLink == link && this.links[i - 1]){
                            this.setActiveTab(this.links[i - 1]);
                            throw $break;
            Severity: Major
            Found in rails/app/assets/javascripts/livepipe/tabs.js and 1 other location - About 3 hrs to fix
            rails/app/assets/javascripts/livepipe/tabs.js on lines 114..121

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

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

                calculateTicks: function(axis){
                    var o = axis.options, i, v;
                    
                    axis.ticks = [];    
                    if(o.ticks){
            Severity: Minor
            Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 3 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 calculateTicks has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

                calculateTicks: function(axis){
                    var o = axis.options, i, v;
                    
                    axis.ticks = [];    
                    if(o.ticks){
            Severity: Minor
            Found in rails/app/assets/javascripts/flotr/flotr.js - About 3 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 drawImage has 77 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              contextPrototype.drawImage = function(image, var_args) {
                var dx, dy, dw, dh, sx, sy, sw, sh;
            
                // to find the original width we overide the width and height
                var oldRuntimeWidth = image.runtimeStyle.width;
            Severity: Major
            Found in rails/app/assets/javascripts/flotr/excanvas.js - About 3 hrs to fix

              Function search has 77 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                search (incremental?: any) {
                  /* eslint-disable react/no-access-state-in-setstate */
                  const displayLimit = incremental ? this.state.displayLimit + DISPLAY_LIMIT_INCREMENT : DISPLAY_LIMIT_INCREMENT;
                  const featuredCollections = incremental ? this.state.featuredCollections.slice(0) : [];
                  let resources = incremental ? this.state.resources.slice(0) : [];
              Severity: Major
              Found in rails/react-components/src/library/components/stem-finder.tsx - About 3 hrs to fix

                File livepipe.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /**
                 * @author Ryan Johnson <http://syntacticx.com/>
                 * @copyright 2008 PersonalGrid Corporation <http://personalgrid.com/>
                 * @package LivePipe UI
                 * @license MIT
                Severity: Minor
                Found in rails/app/assets/javascripts/livepipe/livepipe.js - About 3 hrs to fix

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

                    @Query(() => listMeta)
                    _allPortalStudentPermissionFormsMeta(
                      @Args() {filter, page, perPage, sortField, sortOrder}:PortalStudentPermissionFormQueryArgs) {
                      const where = filter
                      const count = PortalStudentPermissionForm.count({where})
                  admin-panel/graphql-backend/src/resolvers/AdminProjectUserResolver.ts 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 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

                  Severity
                  Category
                  Status
                  Source
                  Language