myGrid/taverna-player

View on GitHub

Showing 18 of 26 total issues

Method interactions has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

    def interactions(run, credentials)
      wait = false

      run.notifications(:requests).each do |note|
        if @run.has_parent?
Severity: Minor
Found in lib/taverna_player/worker.rb - About 7 hrs 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 22 (exceeds 5 allowed). Consider refactoring.
Open

    def perform
      return unless run_callback(TavernaPlayer.pre_run_callback, "pre-callback")

      status_message("connect")

Severity: Minor
Found in lib/taverna_player/worker.rb - About 3 hrs 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

File worker.rb has 277 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module TavernaPlayer
  class Worker
    include TavernaPlayer::Concerns::Callback
    include TavernaPlayer::Concerns::Zip

Severity: Minor
Found in lib/taverna_player/worker.rb - About 2 hrs to fix

    Method perform has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def perform
          return unless run_callback(TavernaPlayer.pre_run_callback, "pre-callback")
    
          status_message("connect")
    
    
    Severity: Major
    Found in lib/taverna_player/worker.rb - About 2 hrs to fix

      Method interactions has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def interactions(run, credentials)
            wait = false
      
            run.notifications(:requests).each do |note|
              if @run.has_parent?
      Severity: Minor
      Found in lib/taverna_player/worker.rb - About 1 hr to fix

        Method process_outputs has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            def process_outputs(run)
              outputs = []
        
              Dir.mktmpdir(run.id, Rails.root.join("tmp")) do |tmp_dir|
                run.output_ports.each_value do |port|
        Severity: Minor
        Found in lib/taverna_player/worker.rb - About 1 hr 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 create_run has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def create_run(server, workflow, credentials)
              retries ||= TavernaPlayer.server_connection_error_retries
              server.create_run(workflow, credentials)
            rescue T2Server::ServerAtCapacityError
              status_message("full")
        Severity: Minor
        Found in lib/taverna_player/worker.rb - About 1 hr 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 set_run_user has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

                  def set_run_user
                    return if params[:run][:embedded] == "true" || TavernaPlayer.user_proxy.nil?
        
                    unless TavernaPlayer.current_user_callback.blank?
                      user = callback(TavernaPlayer.current_user_callback)
        Severity: Minor
        Found in lib/taverna_player/concerns/controllers/runs_controller.rb - About 1 hr 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 failed has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def failed(exception, run = nil)
              begin
                unless run.nil?
                  download_log(run)
                  run.delete
        Severity: Minor
        Found in lib/taverna_player/worker.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 value has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

                def value(*indices)
                  file_path = file.path
                  if depth == 0
                    if file_path.blank?
                      self[:value]
        Severity: Minor
        Found in lib/taverna_player/concerns/models/run_port.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 add_method has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def add_method(name)
              setter = "#{name}_method_name=".to_sym
              mapper = name
        
              (class << self; self; end).instance_eval do
        Severity: Minor
        Found in lib/taverna_player/model_proxy.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 show has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

                def show
                  if @run.running?
                    @interaction = Interaction.find_by_run_id_and_replied(@run.id, false)
                    unless @interaction.nil?
                      unless @interaction.displayed
        Severity: Minor
        Found in lib/taverna_player/concerns/controllers/runs_controller.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 cancel has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

                def cancel
                  return unless incomplete?
        
                  # Set the stop flag for all cases.
                  self.stop = true
        Severity: Minor
        Found in lib/taverna_player/concerns/models/run.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

        Avoid too many return statements within this method.
        Open

                return
        Severity: Major
        Found in lib/taverna_player/worker.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                return unless run_callback(TavernaPlayer.post_run_callback, "post-callback")
          Severity: Major
          Found in lib/taverna_player/worker.rb - About 30 mins to fix

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

                    def cancel
                      @run.cancel unless @run.complete?
            
                      respond_with(@run, :action => :show) do |format|
                        format.html do
            Severity: Minor
            Found in lib/taverna_player/concerns/controllers/runs_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 inputs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                    def inputs
                      workflow = File.open(file)
                      model = T2Flow::Parser.new.parse(workflow)
            
                      result = []
            Severity: Minor
            Found in lib/taverna_player/concerns/models/workflow.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 output has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                    def output
                      # We need to parse out the path into a list of numbers here so we have
                      # a list of indices into the file structure.
                      path = []
                      unless params[:path].nil?
            Severity: Minor
            Found in lib/taverna_player/concerns/controllers/runs_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

            Severity
            Category
            Status
            Source
            Language