myGrid/t2-server-gem

View on GitHub
lib/t2-server/run.rb

Summary

Maintainability
D
3 days
Test Coverage

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 _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 _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 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

        There are no issues that match your filters.

        Category
        Status