Class: Koji::Plugins::PHPDebugBar

Inherits:
Base
  • Object
show all
Defined in:
lib/koji/plugins/php_debugbar.rb

Instance Attribute Summary

Attributes inherited from Base

#website

Instance Method Summary collapse

Methods inherited from Base

inherited, #initialize, #name, #report

Constructor Details

This class inherits a constructor from Koji::Plugins::Base

Instance Method Details

#debug_barObject



10
11
12
# File 'lib/koji/plugins/php_debugbar.rb', line 10

def debug_bar
  website.body&.to_s&.include?("debugbar/debugbar.js") && website.body&.to_s&.include?("debugbar/debugbar.css")
end

#evidence_listObject



14
15
16
17
18
# File 'lib/koji/plugins/php_debugbar.rb', line 14

def evidence_list
  @evidence_list ||= [].tap do |out|
    out << "The website contains PHP DebugBar" if debug_bar || js_debug_bar
  end
end

#js_debug_barObject



6
7
8
# File 'lib/koji/plugins/php_debugbar.rb', line 6

def js_debug_bar
  website.body&.to_s&.include? "var phpdebugbar = new PhpDebugBar.DebugBar()"
end

#scoreObject



20
21
22
# File 'lib/koji/plugins/php_debugbar.rb', line 20

def score
  evidence_list.empty? ? 0 : 100
end