voxable-labs/expando

View on GitHub

Showing 19 of 20 total issues

OS Command Injection in Rake
Open

    rake (10.5.0)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2020-8130

Criticality: High

URL: https://github.com/advisories/GHSA-jppv-gw3r-w3q8

Solution: upgrade to >= 12.3.3

Regular Expression Denial of Service in Addressable templates
Open

    addressable (2.5.2)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2021-32740

Criticality: High

URL: https://github.com/advisories/GHSA-jxhc-q857-3j6g

Solution: upgrade to >= 2.8.0

json Gem for Ruby Unsafe Object Creation Vulnerability (additional fix)
Open

    json (2.0.3)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2020-10663

Criticality: High

URL: https://www.ruby-lang.org/en/news/2020/03/19/json-dos-cve-2020-10663/

Solution: upgrade to >= 2.3.0

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

    def user_says_value(existing_params)
      additional_params = Set.new(existing_params)

      new_user_says = processed_utterances.collect do |utterance|
        # If an entity is referenced on this line...
Severity: Minor
Found in lib/expando/api_ai/objects/intent.rb - About 1 hr to fix

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

        def generate_entity_files(entity_names = nil)
          # TODO: Throw an error when a non-existing entity is requested.

          # Get a list of all entity file names.
          entity_file_names = Dir.entries(entities_path)[2..-1]
Severity: Minor
Found in lib/expando/api_ai/updaters/base.rb and 1 other location - About 1 hr to fix
lib/expando/api_ai/updaters/intent_updater.rb on lines 31..51

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

      def generate_intent_files(intent_names = nil)
        # TODO: Throw an error when a non-existing intent is requested.

        # Get a list of all intent file names.
        intent_file_names = Dir.entries(intents_path)[2..-1]
Severity: Minor
Found in lib/expando/api_ai/updaters/intent_updater.rb and 1 other location - About 1 hr to fix
lib/expando/api_ai/updaters/base.rb on lines 65..85

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

Method user_says_value has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def user_says_value(existing_params)
      additional_params = Set.new(existing_params)

      new_user_says = processed_utterances.collect do |utterance|
        # If an entity is referenced on this line...
Severity: Minor
Found in lib/expando/api_ai/objects/intent.rb - About 45 mins 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

TODO found
Open

    # TODO: Improve documentation for method signature.
Severity: Minor
Found in lib/expando/expander.rb by fixme

TODO found
Open

  # TODO: Default to both in sequence
Severity: Minor
Found in bin/expando by fixme

TODO found
Open

            # TODO: Make this an option
Severity: Minor
Found in lib/expando/api_ai/objects/intent.rb by fixme

TODO found
Open

# TODO: http://api.rubyonrails.org/classes/ActiveSupport/Autoload.html
Severity: Minor
Found in lib/expando.rb by fixme

TODO found
Open

  # Colorizing output for CLI (TODO: drop for pastel)
Severity: Minor
Found in expando.gemspec by fixme

TODO found
Open

          # TODO: Throw an error when a non-existing entity is requested.
Severity: Minor
Found in lib/expando/api_ai/updaters/base.rb by fixme

TODO found
Open

      # TODO: needs an exception class
Severity: Minor
Found in lib/expando/api_ai/objects/intent.rb by fixme

TODO found
Open

          # TODO: Replace multiple spaces with a single space
Severity: Minor
Found in lib/expando/expander.rb by fixme

TODO found
Open

        # TODO: High - throw an error if none.
Severity: Minor
Found in lib/expando/api_ai/objects/intent.rb by fixme

TODO found
Open

    # TODO: High- document, test, and decompose
Severity: Minor
Found in lib/expando/api_ai/objects/intent.rb by fixme

TODO found
Open

        # TODO: Throw an error when a non-existing intent is requested.

TODO found
Open

    # TODO: High - document and test
Severity
Category
Status
Source
Language