edu.colby.cs.JeSS.scanner
Class SecurityScanner

java.lang.Object
  extended byedu.colby.cs.JeSS.scanner.SecurityScanner

public class SecurityScanner
extends java.lang.Object

This class recieves a java Project, Package or Compilation Unit and generates an AST. This AST is then relayed to the VisitorManager class where it is evaluated for security bugs. This process passes the integer warningsCount to track the number of bugs found.

Author:
rspitler

Field Summary
private  VisitorManager vManager
           
 
Constructor Summary
SecurityScanner(org.eclipse.jface.preference.IPreferenceStore store)
           
 
Method Summary
private  int scanCompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit result, org.eclipse.core.resources.IFile file)
          Processes a org.eclipse.jdt.core.dom.CompilationUnit which is the root of an AST and passes it to the VisitorManager for security analysis
 int scanCompilationUnit(org.eclipse.jdt.core.ICompilationUnit compUnit)
          WARNING: do not confuse with the private method of the same name! This method accepts type org.eclipse.jdt.core.ICompilationUnit and then extracts the local resource and generates an AST before it is passed along for security analysis
 int scanPackage(org.eclipse.jdt.core.IPackageFragment fragment)
          Receive a package fragment and extract the compilation units to be processed indiviually.
 int scanProject(org.eclipse.jdt.core.IJavaProject project)
          This method receives a Java project and the projects immediate Resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vManager

private VisitorManager vManager
Constructor Detail

SecurityScanner

public SecurityScanner(org.eclipse.jface.preference.IPreferenceStore store)
Method Detail

scanProject

public int scanProject(org.eclipse.jdt.core.IJavaProject project)
                throws org.eclipse.jdt.core.JavaModelException
This method receives a Java project and the projects immediate Resource. It then extracts the package fragments from the project and calls a helper method to extract the compilation Units from the packages.

Parameters:
project - - the project to be scanned
Returns:
warningsCount - number of bugs found in the project
Throws:
org.eclipse.jdt.core.JavaModelException

scanPackage

public int scanPackage(org.eclipse.jdt.core.IPackageFragment fragment)
                throws org.eclipse.jdt.core.JavaModelException
Receive a package fragment and extract the compilation units to be processed indiviually.

Parameters:
fragment - - the fragment to be processed
Returns:
warningsCount - the number of bugs found
Throws:
org.eclipse.jdt.core.JavaModelException

scanCompilationUnit

public int scanCompilationUnit(org.eclipse.jdt.core.ICompilationUnit compUnit)
WARNING: do not confuse with the private method of the same name! This method accepts type org.eclipse.jdt.core.ICompilationUnit and then extracts the local resource and generates an AST before it is passed along for security analysis

Parameters:
compUnit - - the ICompilationUnit to be analyzed
Returns:
warningsCount - the number of bugs found in this source

scanCompilationUnit

private int scanCompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit result,
                                org.eclipse.core.resources.IFile file)
Processes a org.eclipse.jdt.core.dom.CompilationUnit which is the root of an AST and passes it to the VisitorManager for security analysis

Parameters:
result - the root of the AST to be analyzed
file - the local resource of the CompilationUnit
Returns:
The number of bugs found