concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

Method ipsum has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def ipsum(len)
    text =<<-IPSOM_OVER
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vel neque sit
    amet nisi convallis fermentum. Nulla sit amet velit. Nam suscipit. Nunc vel
    ipsum. Phasellus vestibulum commodo felis. Sed condimentum. Donec ultricies
Severity: Minor
Found in rails/app/helpers/ipsum_helper.rb - About 1 hr to fix

    Method load_schools has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def load_schools
        districts_map = {}
        Portal::District.select("id, nces_district_id").each do |d|
          next unless d.nces_district_id
          districts_map[d.nces_district_id] = d.id
    Severity: Minor
    Found in rails/lib/national_district_importer.rb - About 1 hr to fix

      Method _parse_file_using_import has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def _parse_file_using_import(file, layout, model)
          attributes = {}
          count = 0
          value_sets = []
          column_names = model.columns.map{ |column| column.name }
      Severity: Minor
      Found in rails/lib/nces_parser.rb - About 1 hr to fix

        Function lambdaHandler has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        exports.lambdaHandler = async (event, context) => {
            try {
              const body = validateJSON(event);
        
              if (body.jwt) {
        Severity: Minor
        Found in external-report-demo/report-demo/app.js - About 1 hr 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 generator has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            generator: function(axis) {
                var ticks = [],
                    tickSize = axis.tickSize[0], unit = axis.tickSize[1],
                    d = new Date(axis.min),
                    step = tickSize * timeUnitSize[unit];
        Severity: Minor
        Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 1 hr 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 generator has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            generator: function(axis) {
                var ticks = [],
                    tickSize = axis.tickSize[0], unit = axis.tickSize[1],
                    d = new Date(axis.min),
                    step = tickSize * timeUnitSize[unit];
        Severity: Minor
        Found in rails/app/assets/javascripts/flotr/flotr.js - About 1 hr 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 draw has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          draw: function(event) {
            var pointer = [Event.pointerX(event), Event.pointerY(event)];
            var style = this.element.style;
            if (this.currentDirection.indexOf('n') != -1) {
                var pointerMoved = this.startY - pointer[1];
        Severity: Minor
        Found in rails/app/assets/javascripts/misc/resizable.js - About 1 hr 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 update has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          update: function(event) {
           if(this.active) {
              if(!this.resizing) {
                var style = this.element.style;
                this.resizing = true;
        Severity: Minor
        Found in rails/app/assets/javascripts/misc/resizable.js - About 1 hr 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 initialize has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          def initialize(offering, protocol, host_with_port, current_user, additional_external_report_id, anonymize_students = false)
            runnable = offering.runnable
            self.id = offering.id
            self.teacher = offering.clazz.teacher.name
            self.clazz = offering.clazz.name
        Severity: Minor
        Found in rails/app/models/api/v1/offering.rb - About 1 hr 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 load_schools has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          def load_schools
            districts_map = {}
            Portal::District.select("id, nces_district_id").each do |d|
              next unless d.nces_district_id
              districts_map[d.nces_district_id] = d.id
        Severity: Minor
        Found in rails/lib/national_district_importer.rb - About 1 hr 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 constructor has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          constructor (props: any) {
            super(props);
        
            // it is usually very bad form in React to modify props but we will look the other way this time
            // otherwise we need to clone the array just to add the slug

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

          renderAssignableLinks () {
            const resource = this.state.resource;
            const links = resource.links;
        
            const editLink = resource.lara_activity_or_sequence && links.external_lara_edit

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

          renderIcons () {
            const resource = this.state.resource;
            const links = resource.links;
        
            const makeIcon = (type: any, link: any) => link ? <a className={type} href={type === "settings" ? link.url : link}>{ type }</a> : null;
        Severity: Minor
        Found in rails/react-components/src/library/components/resource-lightbox.tsx - About 1 hr 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 renderSection has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          renderSection (section: any) {
            const { openedSection, location } = this.state;
            const inSection = this.isInSection(openedSection, section.id);
            const inLocation = location.match(section.id);
            const inRoot = section.id === ROOT_SELECTION;
        Severity: Minor
        Found in rails/react-components/src/library/components/navigation/index.tsx - About 1 hr 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 render has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          render () {
            const { standardStatements } = this.props;
            const helpers: any = {};
            const unhelped = [];
        
        

        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

          var options = Object.extend({
            direction: 'center',
            moveTransition: Effect.Transitions.sinoidal,
            scaleTransition: Effect.Transitions.sinoidal,
            opacityTransition: Effect.Transitions.full
        Severity: Major
        Found in rails/app/assets/javascripts/effects.js and 1 other location - About 1 hr to fix
        rails/app/assets/javascripts/effects.js on lines 827..832

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

        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

          var options = Object.extend({
            direction: 'center',
            moveTransition: Effect.Transitions.sinoidal,
            scaleTransition: Effect.Transitions.sinoidal,
            opacityTransition: Effect.Transitions.none
        Severity: Major
        Found in rails/app/assets/javascripts/effects.js and 1 other location - About 1 hr to fix
        rails/app/assets/javascripts/effects.js on lines 753..758

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

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

            getRadiiPixels: function( radii ) {
                var el = this.targetElement,
                    bounds = this.boundsInfo.getBounds(),
                    w = bounds.w,
                    h = bounds.h,
        Severity: Minor
        Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

          Function ajaxHandleResponses has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function ajaxHandleResponses( s, jqXHR, responses ) {
          
              var ct, type, finalDataType, firstDataType,
                  contents = s.contents,
                  dataTypes = s.dataTypes,
          Severity: Minor
          Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

            Function _begin has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _begin: function() {
                  if (this._isPrepared()) return;
            
                  var element = this.element;
                  if (isDisplayed(element)) {
            Severity: Minor
            Found in rails/app/assets/javascripts/prototype.js - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language