gaurav/biburi

View on GitHub

Showing 7 of 7 total issues

Method coins_to_bibtex has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

  def self.coins_to_bibtex(coins)
    # Create a BibTeX entry to store these values.
    bibentry = BibTeX::Entry.new

    # If we have COinS data, we have a lot more data.
Severity: Minor
Found in lib/biburi/driver/coins.rb - About 6 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 coins_to_bibtex has 115 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def self.coins_to_bibtex(coins)
    # Create a BibTeX entry to store these values.
    bibentry = BibTeX::Entry.new

    # If we have COinS data, we have a lot more data.
Severity: Major
Found in lib/biburi/driver/coins.rb - About 4 hrs to fix

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

      def self.lookup(id)
        # Calculate the canonical identifier.
        canonical_id = canonical(id)
        if canonical_id.nil? then
            return nil
    Severity: Minor
    Found in lib/biburi/driver/doi.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 lookup_all has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      def self.lookup_all(id)
        # Calculate the canonical identifier.
        url = canonical(id)
        if url.nil? then
            return nil
    Severity: Minor
    Found in lib/biburi/driver/coins.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 lookup_all has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.lookup_all(id)
        # Calculate the canonical identifier.
        url = canonical(id)
        if url.nil? then
            return nil
    Severity: Minor
    Found in lib/biburi/driver/coins.rb - About 1 hr to fix

      Method lookup has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def self.lookup(id)
          # Calculate the canonical identifier.
          canonical_id = canonical(id)
          if canonical_id.nil? then
              return nil
      Severity: Minor
      Found in lib/biburi/driver/doi.rb - About 1 hr to fix

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

          def self.lookup(id)
            self.drivers.each do |driver|
              if driver.supported?(id) then
                bibtex = driver.lookup(id)  
                return bibtex unless bibtex.nil?
        Severity: Minor
        Found in lib/biburi.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