ontohub/ontohub

View on GitHub

Showing 95 of 107 total issues

Method end_element has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def end_element(name)
      @path.pop
      case name
        when ROOT
        when LOGIC
Severity: Minor
Found in lib/logicgraph_parser.rb - About 1 hr to fix

    Method do_or_set_failed has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def do_or_set_failed(updating_klass = nil, &block)
        raise ArgumentError.new('No block given.') unless block_given?
    
        begin
          yield
    Severity: Minor
    Found in lib/state_updater.rb - About 1 hr to fix

      Method list has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        def list
          typeIri = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'
          labelIri = 'http://www.w3.org/2000/01/rdf-schema#label'
          commentIri = 'http://www.w3.org/2000/01/rdf-schema#comment'
          definedIri = 'http://www.w3.org/2000/01/rdf-schema#isDefinedBy'
      Severity: Minor
      Found in lib/logic_population.rb - About 55 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 list has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        def list
          typeIri = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'
          labelIri = 'http://www.w3.org/2000/01/rdf-schema#label'
          commentIri = 'http://www.w3.org/2000/01/rdf-schema#comment'
          definedIri = 'http://www.w3.org/2000/01/rdf-schema#isDefinedBy'
      Severity: Minor
      Found in lib/language_population.rb - About 55 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 characters has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

            def characters(text)
              case @path.last
              when SYMBOL
                @current_symbol['text'] << text if @current_symbol
              when TEXT
      Severity: Minor
      Found in lib/hets/dg/nokogiri_listener.rb - About 55 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 state_message has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        def state_message
          msg = [state]
          if last_error
            lines = last_error.split("\n")
            if (ind=lines.index("*** Error:")) and (out = lines[ind+1]).present?
      Severity: Minor
      Found in app/models/ontology_version/states.rb - About 55 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_file has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        def commit_file(userinfo, file_contents, target_path, message, &block)
          # throw exception if path is below a file
          if points_through_file?(target_path)
            raise GitRepository::PathBelowFileException
          end
      Severity: Minor
      Found in lib/git_repository/committing.rb - About 55 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 characters has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def characters(text)
            case @path.last
            when SYMBOL
              @current_symbol['text'] << text if @current_symbol
            when TEXT
      Severity: Minor
      Found in lib/ontology_parser.rb - About 55 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 matches? has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        def matches?(request, path = nil)
          path ||= Journey::Router::Utils.
            unescape_uri(request.original_fullpath)
          # retrieves the hierarchy and member portions of loc/id's
          hierarchy_member = path.split('?', 2).first.split('///', 2).first
      Severity: Minor
      Found in lib/router_constraints.rb - About 55 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 exec has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def exec
          if Settings.data_root.join("maintenance.txt").exist?
            STDERR.puts "System in maintenance mode. Please try again later."
            exit 1
          end
      Severity: Minor
      Found in git/lib/git_shell.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

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

        def call
          Semaphore.exclusively(lock_key, expiration: MUTEX_EXPIRATION) do
            unless finished
              transaction do
                preprocess unless other_finished_sine_axiom_selections.any?
      Severity: Minor
      Found in app/models/sine_axiom_selection.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

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

        def commits(start_oid: nil, stop_oid: nil, path: nil, limit: nil, offset: 0, walk_order: nil, &block)
          return [] if @repo.empty?
          start_oid ||= head_oid
          offset = 0 if offset < 0
          stop_oid = nil if stop_oid =~ /\A0+\z/
      Severity: Minor
      Found in lib/git_repository/history.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

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

          def start_element(name, attributes)
            @path << name
            case name
            when ROOT
              callback(:root, Hash[*[attributes]])
      Severity: Minor
      Found in lib/ontology_parser.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

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

        def exec
          # If its push over ssh
          # we need to check user persmission per branch first
          if ssh?
            if api.allowed?('git-receive-pack', @repo_name, @key_id, @branch_name)
      Severity: Minor
      Found in git/lib/git_update.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

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

            def start_element(name, attributes)
              order = :start
              @path << name
              case name
              when ROOT
      Severity: Minor
      Found in lib/hets/dg/nokogiri_listener.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

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

        def active_navigation(controller)
          alternatives = [controller.to_s, controller.to_s.gsub('_', '/')]
          if params[:repository_id]
            if params[:ontology_id]
              'active' if controller == :ontologies
      Severity: Minor
      Found in app/helpers/navigation_helper.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

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

        def wrapped_button(*args, &block)
          template.content_tag :div, :class => "form-group" do
            template.content_tag :div, class: 'col-lg-offset-2 col-lg-10' do
              options = args.extract_options!
              loading = self.object.new_record? ? I18n.t('simple_form.creating') : I18n.t('simple_form.updating')
      Severity: Minor
      Found in lib/simple_form_extensions.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

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

        def initialize(opts)
          @repository   = Repository.find_by_path(opts[:repository_id])
      
          @commit_id    = compute_ref(repository, opts[:ref])
          @oid          = commit_id[:oid] unless repository.empty?
      Severity: Minor
      Found in app/fake_records/history_entries_page.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

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

          def choose!(try_again: true)
            raise NoRegisteredHetsInstanceError.new unless any?
            instance = exclusively { choose_set_instance }
            if instance && instance.send(:check_up_state)
              instance
      Severity: Minor
      Found in app/models/hets_instance.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

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

        def entry_info_list_rugged(rugged_commit, path)
          entries = []
      
          changing_rugged_commit = get_commit_of_last_change(path, rugged_commit)
          previous_rugged_commit = nil
      Severity: Minor
      Found in lib/git_repository/get_info_list.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

      Severity
      Category
      Status
      Source
      Language