rubinius/rubinius

View on GitHub
library/rubygems/request_set/lockfile/parser.rb

Summary

Maintainability
D
1 day
Test Coverage

Method parse_GEM has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

  def parse_GEM # :nodoc:
    sources = []

    while [:entry, 'remote'] == peek.first(2) do
      get :entry, 'remote'
Severity: Minor
Found in library/rubygems/request_set/lockfile/parser.rb - About 2 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 parse_GEM has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def parse_GEM # :nodoc:
    sources = []

    while [:entry, 'remote'] == peek.first(2) do
      get :entry, 'remote'
Severity: Minor
Found in library/rubygems/request_set/lockfile/parser.rb - About 1 hr to fix

    Method parse_GIT has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def parse_GIT # :nodoc:
        get :entry, 'remote'
        repository = get(:text).value
    
        skip :newline
    Severity: Minor
    Found in library/rubygems/request_set/lockfile/parser.rb - About 1 hr to fix

      Method parse_DEPENDENCIES has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        def parse_DEPENDENCIES # :nodoc:
          while not @tokens.empty? and :text == peek.type do
            token = get :text
      
            requirements = []
      Severity: Minor
      Found in library/rubygems/request_set/lockfile/parser.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 parse_GIT has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

        def parse_GIT # :nodoc:
          get :entry, 'remote'
          repository = get(:text).value
      
          skip :newline
      Severity: Minor
      Found in library/rubygems/request_set/lockfile/parser.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 parse_PATH has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def parse_PATH # :nodoc:
          get :entry, 'remote'
          directory = get(:text).value
      
          skip :newline
      Severity: Minor
      Found in library/rubygems/request_set/lockfile/parser.rb - About 1 hr to fix

        Method parse_PATH has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

          def parse_PATH # :nodoc:
            get :entry, 'remote'
            directory = get(:text).value
        
            skip :newline
        Severity: Minor
        Found in library/rubygems/request_set/lockfile/parser.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 parse has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

          def parse
            until @tokens.empty? do
              token = get
        
              case token.type
        Severity: Minor
        Found in library/rubygems/request_set/lockfile/parser.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 parse_DEPENDENCIES has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def parse_DEPENDENCIES # :nodoc:
            while not @tokens.empty? and :text == peek.type do
              token = get :text
        
              requirements = []
        Severity: Minor
        Found in library/rubygems/request_set/lockfile/parser.rb - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status