concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

Method name_for_component has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def name_for_component(component, options={})
    if options[:display_name]
      return options[:display_name]
    end
    name = ''
Severity: Minor
Found in rails/app/helpers/application_helper.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 create has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def create
    # PUNDIT_REVIEW_AUTHORIZE
    # PUNDIT_CHECK_AUTHORIZE
    # authorize Portal::Teacher

Severity: Minor
Found in rails/app/controllers/portal/teachers_controller.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 create has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def create
    authorize Interactive
    @interactive = Interactive.new(interactive_strong_params(params[:interactive]))
    @interactive.user = current_visitor

Severity: Minor
Found in rails/app/controllers/interactives_controller.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 student_roster_props has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def student_roster_props(portal_clazz=@portal_clazz)

    can_edit = portal_clazz.changeable?(current_visitor)

    students = []
Severity: Minor
Found in rails/app/helpers/portal/clazzes_helper.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 recursive_symbolize_keys has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def recursive_symbolize_keys
    inject({}) do |acc, (k,v)|
      key = String === k ? k.to_sym : k
      case v
      when Hash
Severity: Minor
Found in rails/lib/app_settings.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 shortenText has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const shortenText = (text: any, length: any, breakOnSpace: any) => {
  let shortenedText = text;
  length = (typeof length !== "undefined") ? length : 350;
  if (!text) {
    return "";
Severity: Minor
Found in rails/react-components/src/library/helpers/portal-object-helpers.ts - 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 PermissionFormRow has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const PermissionFormRow: React.FC<PermissionFormRowProps> = ({ permissionForm, onEditModalToggle, onEdit, onDelete }) => {
  const handleEditModal = () => {
    onEditModalToggle(permissionForm);
  };

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

  search (query: any) {
    const setSuggestions = (suggestions: any, callback?: any) => {
      const showSuggestions = suggestions.length > 0;
      this.setState({ suggestions, selectedSuggestionIndex: -1, showSuggestions }, callback);
    };

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

export default function ManageFormsTab() {
  // Fetch projects and permission forms (with refetch function) on initial load
  const { data: permissionsData, refetch: refetchPermissions } = useFetch<IPermissionForm[]>(Portal.API_V1.PERMISSION_FORMS, []);
  const { data: projectsData } = useFetch<IProject[]>(Portal.API_V1.PERMISSION_FORMS_PROJECTS, []);

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

  renderResultsHeader () {
    const { displayLimit, noResourcesFound, numTotalResources, searching, usersAuthoredResourcesCount } = this.state;
    const finderHeaderClass = this.isAdvancedUser() || usersAuthoredResourcesCount > 0 ? `${css.finderHeader} ${css.advanced}` : css.finderHeader;

    if (noResourcesFound || searching) {
Severity: Minor
Found in rails/react-components/src/library/components/stem-finder.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 renderInput has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  renderInput (name: any, titleOverride?: any) {
    if (!this.state.filterables[name]) { return; }

    const hits = this.state.filterables[name];

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 10 (exceeds 5 allowed). Consider refactoring.
Open

  render () {
    const { bookmark } = this.props;
    const { editing } = this.state;

    const handleDelete = () => this.props.handleDelete(bookmark);

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

  renderInput (name: any, titleOverride?: any) {
    if (!this.state.filterables[name]) { return; }
    const agg = this.state.filterables[name];

    const isLoading = this.state[`waitingFor_${name}`];

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

  scroll: function(deltaPixel) {
    if (this.animating)
      return this;

    // Compute new position
Severity: Minor
Found in rails/public/javascripts/light_box.js - About 1 hr to fix

    Function createList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      createList: function(items) {
        var list = new Element('ul');
    
        items.each(function(item){
          list.insert(
    Severity: Minor
    Found in rails/public/javascripts/light_box.js - About 1 hr to fix

      Function addClass has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          addClass: function( value ) {
              var classNames, i, l, elem,
                  setClass, c, cl;
      
              if ( jQuery.isFunction( value ) ) {
      Severity: Minor
      Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

        Function find has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            find: function( selector ) {
                var i, l, length, n, r, ret,
                    self = this;
        
                if ( typeof selector !== "string" ) {
        Severity: Minor
        Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

          Function setup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  setup: function() {
          
                      if ( rformElems.test( this.nodeName ) ) {
                          // IE doesn't fire change on a check/radio until blur; trigger it on click
                          // after a propertychange. Eat the blur-change in special.change.handle.
          Severity: Minor
          Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

            Function propFilter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function propFilter( props, specialEasing ) {
                var index, name, easing, value, hooks;
            
                // camelCase, specialEasing and expand cssHook pass
                for ( index in props ) {
            Severity: Minor
            Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

              Function simulate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                Event.simulate = function(element, eventName) {
                  var options = Object.extend(defaultOptions, arguments[2] || { });
                  var oEvent, eventType = null;
                  
                  element = $(element);
              Severity: Minor
              Found in rails/app/assets/javascripts/pt_event_simulate.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language