ontohub/ontohub

View on GitHub

Showing 95 of 107 total issues

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

    def build_api_uri(command, arguments = [], query_string = {})
      hierarchy = [hets_instance.uri, command, *arguments].join('/')
      query_part =
        if query_string && !query_string.empty?
          query_string.reduce('?') do |str, (key, val)|
Severity: Minor
Found in lib/hets/caller.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 perform has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def perform(version_with_options_queue)
    return if version_with_options_queue.empty?
    initialize_data(version_with_options_queue)

    timeout_job_id = ::TimeoutWorker.start_timeout_clock(@version_id)
Severity: Minor
Found in lib/ontology_parsing_worker.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 get_object has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def get_object(rugged_commit, object_path='')
    object = rugged_commit.tree
    object_path.split('/').each do |part|
      return nil unless object[part]
      object = @repo.lookup(object[part][:oid]) unless part.empty?
Severity: Minor
Found in lib/git_repository/get_object.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 suspended_save_ontologies has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def suspended_save_ontologies(options={})
    versions = []
    commits_count = 0
    highest_change_file_count = 0
    user = options.delete(:user)
Severity: Minor
Found in lib/ontology_saver.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 path_exists? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def path_exists?(path, commit_oid = nil)
    return true if path == '/' || path.empty?
    return false if empty?
    rugged_commit = get_commit(commit_oid)
    if !rugged_commit && path.empty?
Severity: Minor
Found in lib/git_repository.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 in_process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def self.in_process(user=nil)
      return [] if user.nil?
      state = "done"
      stmt = ['state != ?', state] if user == true
      if user.is_a?(User)
Severity: Minor
Found in app/models/ontology/versions.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_used_axioms has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def process_used_axioms(proof_info, proof_attempt)
        used_axioms = []
        used_theorems = []
        generated_axioms = []
        proof_info[:used_axioms].each do |axiom_name|
Severity: Minor
Found in lib/hets/prove/prove_evaluation_helper.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 mapping has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def mapping(current_element)
        if logic_callback.pre_mapping(current_element)
          alias_iris_for_mappings!(current_element)
          mapping = parent_ontology.mappings.update_or_create_from_hash(
            current_element, user, importer.now)
Severity: Minor
Found in lib/hets/dg/node_evaluator.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 symbol has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def symbol(current_element)
        if logic_callback.pre_symbol(current_element)
          symbol = ontology.symbols.update_or_create_from_hash(
            current_element, importer.now)
          ontology.symbols_count += 1
Severity: Minor
Found in lib/hets/dg/node_evaluator.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 check_read_permissions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def check_read_permissions
    unless params[:action] == 'index'
      authorize! :show, resource.source.repository if resource.source
      authorize! :show, resource.target.repository if resource.target
    end
Severity: Minor
Found in app/controllers/mappings_controller.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 commit_raw_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def commit_raw_file
    return true if ontology.parent
    raise "raw file missing" unless @raw_file
    self.path = @raw_file.original_filename if self.path.nil?
    # otherwise the file upload is broken (no implicit conversion of ActionDispatch::Http::UploadedFile into String):
Severity: Minor
Found in app/models/ontology_version/files.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 import_remote has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def import_remote(type, user, source, name, params={})
      unless SOURCE_TYPES.include?(type)
        raise ArgumentError, "invalid source type: #{type}"
      end
      unless GitRepository.send "is_#{type}_repository?", source
Severity: Minor
Found in app/models/repository/importing.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 deepest_existing_dir has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def deepest_existing_dir(path, commit_oid = nil)
    path ||= '/'
    dirs = path.split('/')

    dir = nil
Severity: Minor
Found in lib/git_repository.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 search_with_params has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def search_with_params
    if params[:query].present? && in_repository
      search_params = params[:query].split(' ')
      @anded << search_params.delete(search_params.first)
      @anded = @anded.join(' AND ')
Severity: Minor
Found in lib/ontology_search.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 axiom has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def axiom(current_element)
        if logic_callback.pre_axiom(current_element)
          axiom = ontology.axioms.update_or_create_from_hash(
            current_element, importer.now)
          ontology.axioms_count += 1
Severity: Minor
Found in lib/hets/dg/node_evaluator.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