Class: Pipeline::ScanJS

Inherits:
BaseTask show all
Defined in:
lib/pipeline/tasks/scanjs.rb

Instance Attribute Summary

Attributes inherited from BaseTask

#appname, #description, #findings, #labels, #name, #stage, #trigger, #warnings

Instance Method Summary collapse

Methods inherited from BaseTask

#directories_with?, #report, #severity, #warn

Constructor Details

#initialize(trigger, tracker) ⇒ ScanJS

WIP

Pipeline::Tasks.add self


8
9
10
11
12
13
14
# File 'lib/pipeline/tasks/scanjs.rb', line 8

def initialize(trigger, tracker)
	super(trigger)
  @name = "ScanJS"
  @description = "Source analysis for JavaScript"
  @stage = :code
  @labels << "code" << "javascript"
end

Instance Method Details

#analyzeObject



22
23
24
# File 'lib/pipeline/tasks/scanjs.rb', line 22

def analyze
  puts @result
end

#runObject



16
17
18
19
20
# File 'lib/pipeline/tasks/scanjs.rb', line 16

def run
  Pipeline.notify "#{@name}"
	rootpath = @trigger.path
 @result=`scanner.js -t "#{rootpath}"`
end

#supported?Boolean

Returns:

  • (Boolean)


26
27
28
29
# File 'lib/pipeline/tasks/scanjs.rb', line 26

def supported?
	# In future, verify tool is available.
	return true
end