cortex-cms/cortex

View on GitHub

Showing 72 of 72 total issues

Devise Gem for Ruby Time-of-check Time-of-use race condition with lockable module
Open

    devise (4.4.3)
Severity: Minor
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2019-5421

URL: https://github.com/plataformatec/devise/issues/4981

Solution: upgrade to >= 4.6.0

Nokogiri gem, via libxslt, is affected by improper access control vulnerability
Open

    nokogiri (1.8.4)
Severity: Minor
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2019-11068

URL: https://github.com/sparklemotion/nokogiri/issues/1892

Solution: upgrade to >= 1.10.3

Function reducer has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  return function reducer(state = initialState, action) {
    switch (action.type) {
      case PAGINATE_BACK:
        return {
          ...state,
Severity: Minor
Found in node_package/src/reducers/tenant_switcher_reducer.jsx - About 1 hr to fix

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

        def update
          update_content_item
            .with_step_args(
              execute_content_item_state_change: [state: params[:content_item][:state]]
            )
    Severity: Major
    Found in app/controllers/cortex/content_items_controller.rb and 1 other location - About 1 hr to fix
    app/controllers/cortex/content_items_controller.rb on lines 61..80

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

    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

        def create
          create_content_item
            .with_step_args(
              execute_content_item_state_change: [state: params[:content_item][:state]]
            )
    Severity: Major
    Found in app/controllers/cortex/content_items_controller.rb and 1 other location - About 1 hr to fix
    app/controllers/cortex/content_items_controller.rb on lines 37..56

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

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

      render() {
        const {
          environment,
          environment_abbreviated,
          currentUser,
    Severity: Minor
    Found in node_package/src/containers/tenant_switcher_container.jsx - About 1 hr to fix

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

          $('.quick-links .jumbo-button').hover(function () {
            $(this).find('.jumbo-button__content__icon').css('display', 'none');
            $(this).find('.jumbo-button__content__add').css('display', 'block');
          }, function () {
      Severity: Minor
      Found in app/assets/javascripts/cortex/quick_links.js and 1 other location - About 55 mins to fix
      app/assets/javascripts/cortex/quick_links.js on lines 8..11

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

      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

          }, function () {
            $(this).find('.jumbo-button__content__icon').css('display', 'block');
            $(this).find('.jumbo-button__content__add').css('display', 'none');
          });
      Severity: Minor
      Found in app/assets/javascripts/cortex/quick_links.js and 1 other location - About 55 mins to fix
      app/assets/javascripts/cortex/quick_links.js on lines 5..8

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

      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

      Possible DoS vulnerability in Rack
      Open

          rack (2.0.5)
      Severity: Minor
      Found in Gemfile.lock by bundler-audit

      Advisory: CVE-2018-16470

      URL: https://groups.google.com/forum/#!topic/ruby-security-ann/Dz4sRl-ktKk

      Solution: upgrade to >= 2.0.6

      Nokogiri gem, via libxml2, is affected by multiple vulnerabilities
      Open

          nokogiri (1.8.4)
      Severity: Minor
      Found in Gemfile.lock by bundler-audit

      Advisory: CVE-2018-14404

      URL: https://github.com/sparklemotion/nokogiri/issues/1785

      Solution: upgrade to >= 1.8.5

      Possible XSS vulnerability in Rack
      Open

          rack (2.0.5)
      Severity: Minor
      Found in Gemfile.lock by bundler-audit

      Advisory: CVE-2018-16471

      URL: https://groups.google.com/forum/#!topic/ruby-security-ann/NAalCee8n6o

      Solution: upgrade to ~> 1.6.11, >= 2.0.6

      Loofah XSS Vulnerability
      Open

          loofah (2.2.2)
      Severity: Minor
      Found in Gemfile.lock by bundler-audit

      Advisory: CVE-2018-16468

      URL: https://github.com/flavorjones/loofah/issues/154

      Solution: upgrade to >= 2.2.3

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

      const tenantSwitcherReducer = ({active_tenant, csrf_token, sidebarExpanded, tenants, current_user, environment, environment_abbreviated}) => {
      Severity: Minor
      Found in node_package/src/reducers/tenant_switcher_reducer.jsx and 1 other location - About 50 mins to fix
      node_package/src/containers/tenant_switcher_container.jsx on lines 73..81

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

      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

          const {
            environment,
            environment_abbreviated,
            currentUser,
            activeTenant,
      Severity: Minor
      Found in node_package/src/containers/tenant_switcher_container.jsx and 1 other location - About 50 mins to fix
      node_package/src/reducers/tenant_switcher_reducer.jsx on lines 12..12

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

      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

          const {activeTenant, parentTenant, selectTenant, subTenantListClicked, tenantLookupTable} = this.props;
      Severity: Minor
      Found in node_package/src/components/side_bar/tenant_list.jsx and 1 other location - About 35 mins to fix
      node_package/src/components/wizard/step.jsx on lines 10..10

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

      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

          const {name, heading, contentItemFieldLookup, description, columns} = this.props
      Severity: Minor
      Found in node_package/src/components/wizard/step.jsx and 1 other location - About 35 mins to fix
      node_package/src/components/side_bar/tenant_list.jsx on lines 31..31

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

      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

              {temporary_render === 'TenantSwitcher' &&
              <TenantSwitcherContainer dispatch={dispatch} railsContext={data.railsContext} data={data.session}/>
              }
      Severity: Minor
      Found in node_package/src/containers/layout.jsx and 1 other location - About 35 mins to fix
      node_package/src/containers/layout.jsx on lines 25..27

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

      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

              {temporary_render === 'Wizard' &&
              <WizardContainer dispatch={dispatch} railsContext={data.railsContext} data={data.wizard}/>
              }
      Severity: Minor
      Found in node_package/src/containers/layout.jsx and 1 other location - About 35 mins to fix
      node_package/src/containers/layout.jsx on lines 22..24

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

      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

      Broken Access Control vulnerability in Active Job
      Open

          activejob (5.1.6)
      Severity: Minor
      Found in Gemfile.lock by bundler-audit

      Advisory: CVE-2018-16476

      URL: https://groups.google.com/forum/#!topic/rubyonrails-security/FL4dSdzr2zw

      Solution: upgrade to ~> 4.2.11, ~> 5.0.7.1, ~> 5.1.6.1, ~> 5.1.7, >= 5.2.1.1

      Unused block argument - options. If it's necessary, use _ or _options as an argument name to indicate that it won't be used.
      Open

            validations.all? do |type, options|
      Severity: Minor
      Found in app/models/cortex/field_type.rb by rubocop

      This cop checks for unused block arguments.

      Example:

      # bad
      
      do_something do |used, unused|
        puts used
      end
      
      do_something do |bar|
        puts :foo
      end
      
      define_method(:foo) do |bar|
        puts :baz
      end

      Example:

      #good
      
      do_something do |used, _unused|
        puts used
      end
      
      do_something do
        puts :foo
      end
      
      define_method(:foo) do |_bar|
        puts :baz
      end
      Severity
      Category
      Status
      Source
      Language