rosette-proj/rosette-core

View on GitHub

Showing 25 of 33 total issues

Method process_each_phrase has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def process_each_phrase(repo_name, commit_ref)
        if block_given?
          repo_config = config.get_repo(repo_name)
          rev_walk = RevWalk.new(repo_config.repo.jgit_repo)
          diff_finder = DiffFinder.new(repo_config.repo.jgit_repo, rev_walk)
Severity: Minor
Found in lib/rosette/core/extractor/commit_processor.rb - About 25 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

Method process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def process(object)
        should_process = !configuration.applies_to_proc ||
          configuration.applies_to_proc.call(object)

        if should_process
Severity: Minor
Found in lib/rosette/preprocessors/preprocessor.rb - About 25 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

Method write_translations_for has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def write_translations_for(snapshot, serializer_instance)
          each_translation(snapshot) do |trans|
            next unless include_trans?(trans)
            trans = apply_preprocessors(trans, serializer_config)
            yield trans if block_given?
Severity: Minor
Found in lib/rosette/core/commands/translations/export_command.rb - About 25 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

Method find_const has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def find_const(candidates, namespace)
          candidates.each do |segments|
            found_const = segments.inject(namespace) do |const, segment|
              if const && const.constants.include?(segment.to_sym)
                const.const_get(segment)
Severity: Minor
Found in lib/rosette/core/resolvers/resolver.rb - About 25 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

Method use_tms has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def use_tms(tms, options = {})
        const = case tms
          when String
            if const = find_tms_const(tms)
              const
Severity: Minor
Found in lib/rosette/core/extractor/repo_config.rb - About 25 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

Severity
Category
Status
Source
Language