myGrid/t2-server-gem

View on GitHub

Showing 15 of 15 total issues

Class Run has 80 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Run
    include XML::Methods

    private_class_method :new

Severity: Major
Found in lib/t2-server/run.rb - About 1 day to fix

    File run.rb has 576 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'base64'
    require 'time'
    require 'taverna-baclava'
    
    module T2Server
    Severity: Major
    Found in lib/t2-server/run.rb - About 1 day to fix

      Method poll has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

            def poll(type = :all)
              updates = []
              requests = @cache[:requests]
              replies = @cache[:replies]
      
      
      Severity: Minor
      Found in lib/t2-server/interaction.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

      Class Server has 26 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class Server
          include XML::Methods
      
          # :stopdoc:
          # Internal references to the main rest and admin top-level resource
      Severity: Minor
      Found in lib/t2-server/server.rb - About 3 hrs to fix

        Method value has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def value(range = nil, &block)
              # The following block is a workaround for Taverna Server versions prior
              # to 2.4.1 and can be removed when support for those versions is no
              # longer required.
              if error? && @size == 0
        Severity: Minor
        Found in lib/t2-server/port.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 _fake_lists has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def _fake_lists
              data_map = {}
        
              input_ports.each_value do |port|
                next unless port.set?
        Severity: Minor
        Found in lib/t2-server/run.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_all_inputs has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def _set_all_inputs
              input_ports.each_value do |port|
                next unless port.set?
        
                uri = Util.append_to_uri_path(links[:inputs], "input/#{port.name}")
        Severity: Minor
        Found in lib/t2-server/run.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_peer_verification has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def set_peer_verification
              if @params[:verify_peer]
                if @params[:ca_file]
                  @http.ca_file = @params[:ca_file]
                end
        Severity: Minor
        Found in lib/t2-server/net/connection.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 connect has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def ConnectionFactory.connect(uri, params = nil)
              # we want to use URIs here
              if !uri.is_a? URI
                raise URI::InvalidURIError.new
              end
        Severity: Minor
        Found in lib/t2-server/net/connection.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 GET has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def GET(uri, type, range, credentials, &block)
        Severity: Minor
        Found in lib/t2-server/net/connection.rb - About 35 mins to fix

          Method xml_keypair_cred_fragment has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                def xml_keypair_cred_fragment(uri, name, key, type, password)
          Severity: Minor
          Found in lib/t2-server/xml/methods.rb - About 35 mins to fix

            Method add_keypair_credential has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def add_keypair_credential(uri, filename, password,
                                           name = "Imported Certificate", type = :pkcs12)
            Severity: Minor
            Found in lib/t2-server/run.rb - About 35 mins to fix

              Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def initialize(port, ref, error, size, type = "")
              Severity: Minor
              Found in lib/t2-server/port.rb - About 35 mins to fix

                Method initialize_run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def initialize_run(workflow, credentials = nil)
                      # If workflow is a String, it might be a filename! If so, stream it.
                      if (workflow.instance_of? String) && (File.file? workflow)
                        return File.open(workflow, "r") do |file|
                          create(links[:runs], file, "application/vnd.taverna.t2flow+xml",
                Severity: Minor
                Found in lib/t2-server/server.rb - About 35 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/t2-server/port.rb - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language