shadowbq/pastenum

View on GitHub

Showing 13 of 15 total issues

Method initialize has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

    def initialize  
      options = {}
      
      options[:pastebin] = true
      options[:gist] = true
Severity: Minor
Found in lib/pastenum/cli.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 initialize has 158 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def initialize  
      options = {}
      
      options[:pastebin] = true
      options[:gist] = true
Severity: Major
Found in lib/pastenum/cli.rb - About 6 hrs to fix

    Method page_numbers has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        def page_numbers
          page_num = 1
          next_page = true
          
          print "[*] Parsing pages:".green if @verbose
    Severity: Minor
    Found in lib/pastenum/targets/gist.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 to_file has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def to_file
          puts "[*] Creating HTML Report".green
          print "[*] Status: ".green
          file = File.open('report.html', 'w') 
        
    Severity: Major
    Found in lib/pastenum/report.rb - About 2 hrs to fix

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

          def search
            puts "[*] Searching Pastie.com (Limit: First #{@max_pages} Pages)".green if @verbose
            q = GScraper::Search.query(:query => @dork + " inurl:pastes -inurl:page", :site => 'pastie.org')
            print "[*] Parsing pages:".green if @verbose
            begin
      Severity: Minor
      Found in lib/pastenum/targets/pastie.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 search has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def search
            puts "[*] Searching Github".green if @verbose
            current_page = 1
            page_numbers.times do
              print ".".green if @verbose
      Severity: Minor
      Found in lib/pastenum/targets/github.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 search has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def search
            puts "[*] Searching Gist".green if @verbose
            current_page = 1
            page_numbers.times do
              print ".".green if @verbose
      Severity: Minor
      Found in lib/pastenum/targets/gist.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 search has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def search
            puts "[*] Searching Pastebin.com (Limit: First #{@max_pages} Pages)".green if @verbose
            q = GScraper::Search.query(:query => @dork, :site => 'pastebin.com')
            print "[*] Parsing pages: ".green if @verbose
            begin
      Severity: Minor
      Found in lib/pastenum/targets/pastebin.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 to_file has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def to_file
            puts "[*] Creating HTML Report".green
            print "[*] Status: ".green
            file = File.open('report.html', 'w') 
          
      Severity: Minor
      Found in lib/pastenum/report.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 search has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def search
            puts "[*] Searching Pastee.org (Limit: First #{@max_pages} Pages)".green if @verbose
            q = GScraper::Search.query(:query => @dork + " intitle:'Paste' ", :site => 'pastee.org')
            print "[*] Parsing pages:".green if @verbose
            begin
      Severity: Minor
      Found in lib/pastenum/targets/pastee.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 page_numbers has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def page_numbers
            print "[*] Parsing pages:".green if @verbose
            
            print "#".green if @verbose
            
      Severity: Minor
      Found in lib/pastenum/targets/github.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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def initialize(search_string)
            @dork ||= search_string
            
            @vendor ||= "TargetTemplate"
            @raw_url ||= "TargetRawTemplate"
      Severity: Minor
      Found in lib/pastenum/target.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 initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def initialize(dork,addresses_pastie,addresses_pastee,addresses_pastebin,addresses_github,addresses_gist)
      Severity: Minor
      Found in lib/pastenum/report.rb - About 45 mins to fix
        Severity
        Category
        Status
        Source
        Language