concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

Function getGradientMetrics has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    getGradientMetrics: function( el, width, height, gradientInfo ) {
        var angle = gradientInfo.angle,
            startPos = gradientInfo.gradientStart,
            startX, startY,
            endX, endY,
Severity: Major
Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 2 hrs to fix

    Method create has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def create
        # PUNDIT_REVIEW_AUTHORIZE
        # PUNDIT_CHECK_AUTHORIZE
        # authorize Portal::Clazz
    
    
    Severity: Major
    Found in rails/app/controllers/portal/clazzes_controller.rb - About 2 hrs to fix

      Method up has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def self.up
          create_table :calibrations do |t|
            t.integer :data_filter_id
            t.integer :probe_type_id
            t.boolean :default_calibration
      Severity: Major
      Found in rails/db/migrate/20090401095316_probes_and_more.rb - About 2 hrs to fix

        Function matcherFromGroupMatchers has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
            var bySet = setMatchers.length > 0,
                byElement = elementMatchers.length > 0,
                superMatcher = function( seed, context, xml, results, expandContext ) {
                    var elem, j, matcher,
        Severity: Major
        Found in rails/app/assets/javascripts/jquery/jquery.js - About 2 hrs to fix

          Function dropdown_for has 69 lines of code (exceeds 25 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: Major
          Found in rails/app/assets/javascripts/dropdown.js - About 2 hrs to fix

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

              render () {
                const { signupText, oauthProviders, anonymous, omniauthOrigin } = this.props;
                const { userType, basicData, studentData, teacherData } = this.state;
            
                let form;
            Severity: Major
            Found in rails/react-components/src/library/components/signup/signup.tsx - About 2 hrs to fix

              Function Enumerable has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

              var Enumerable = (function() {
                function each(iterator, context) {
                  try {
                    this._each(iterator, context);
                  } catch (e) {
              Severity: Minor
              Found in rails/app/assets/javascripts/prototype.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

              Function drawGrid has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  drawGrid: function(){
                      var v, o = this.options,
                          ctx = this.ctx;
                      if(o.grid.verticalLines || o.grid.horizontalLines){
                          this.el.fire('flotr:beforegrid', [this.axes.x, this.axes.y, o, this]);
              Severity: Minor
              Found in rails/app/assets/javascripts/flotr/flotr_out.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

              Function drawGrid has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  drawGrid: function(){
                      var v, o = this.options,
                          ctx = this.ctx;
                      if(o.grid.verticalLines || o.grid.horizontalLines){
                          this.el.fire('flotr:beforegrid', [this.axes.x, this.axes.y, o, this]);
              Severity: Minor
              Found in rails/app/assets/javascripts/flotr/flotr.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

              Function handleKeyDown has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                handleKeyDown (e: any) {
                  let handledKey = false;
                  const { query, suggestions, selectedSuggestionIndex, showSuggestions } = this.state;
                  const { onChange, onSubmit } = this.props;
                  const suggestion = suggestions[selectedSuggestionIndex];
              Severity: Minor
              Found in rails/react-components/src/library/components/search/auto-suggest.tsx - 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 renderNavLinks has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                renderNavLinks (e: any) {
                  const headerItems = [];
                  let key = 1;
                  const nextKey = (prefix: any) => `navLink_${prefix}_${key++}`;
                  if (!this.state.isStudent) {
              Severity: Minor
              Found in rails/react-components/src/library/components/page-header.tsx - 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 renderLinks has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                renderLinks () {
                  const { resource } = this.props;
                  const isCollection = resource.material_type === "Collection";
                  const isAssignWrapped = window.self !== window.top &&
                    window.self.location.hostname === window.top?.location.hostname;
              Severity: Minor
              Found in rails/react-components/src/library/components/stem-finder-result.tsx - 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

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

                  if (
                    scrollTop > window.innerHeight / 2 &&
                    !this.state.searching &&
                    this.state.resources.length !== 0 &&
                    !(this.state.displayLimit >= this.state.numTotalResources)
              rails/react-components/src/library/components/stem-finder.tsx on lines 210..217

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

              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 (
                    scrollTop > window.innerHeight / 3 &&
                    !this.state.searching &&
                    this.state.resources.length !== 0 &&
                    !(this.state.displayLimit >= this.state.numTotalResources)
              rails/react-components/src/library/components/stem-finder.tsx on lines 198..205

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

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

                function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                  var bySet = setMatchers.length > 0,
                    byElement = elementMatchers.length > 0,
                    superMatcher = function( seed, context, xml, results, outermost ) {
                      var elem, j, matcher,
              Severity: Major
              Found in rails/app/assets/javascripts/prototype.js - About 2 hrs to fix

                Function Grow has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Effect.Grow = function(element) {
                  element = $(element);
                  var options = Object.extend({
                    direction: 'center',
                    moveTransition: Effect.Transitions.sinoidal,
                Severity: Major
                Found in rails/app/assets/javascripts/effects.js - About 2 hrs to fix

                  Method query has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def query(options, user)
                  
                      results = {}
                  
                      scopes = {
                  Severity: Major
                  Found in rails/app/controllers/api/v1/report_users_controller.rb - About 2 hrs to fix

                    Method create_default_clazzes has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def self.create_default_clazzes
                        # this method creates default classes,
                        # teacher class mapping
                        # student class mapping
                    
                    
                    Severity: Major
                    Found in rails/lib/mock_data/create_default_data.rb - About 2 hrs to fix

                      File teacher_form.tsx has 280 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import React from "react";
                      import Formsy from "formsy-react";
                      
                      import TextInput from "./text_input";
                      import CheckboxInput from "./checkbox_input";
                      Severity: Minor
                      Found in rails/react-components/src/library/components/signup/teacher_form.tsx - About 2 hrs to fix

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

                        document.whenReady(function() {
                          if ($('log'))             UI.logger = new UI.ElementLogger('log');
                          else if (window.console)  UI.logger = new UI.ConsoleLogger();
                          else                      UI.logger = new UI.MemLogger();
                        });
                        Severity: Major
                        Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 2 hrs to fix
                        rails/public/javascripts/light_box.js on lines 2453..2457

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

                        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