public function main()
    {
        if (!isset($this->analyzerPath)) {
            throw new BuildException("Missing attribute 'analyzerPath'");
        }

        if (!isset($this->file) and count($this->filesets) == 0) {
            throw new BuildException("Missing either a nested fileset or attribute 'file' set");
        }

        if ($this->file instanceof PhingFile) {
            $this->analyze($this->file->getPath());
        } else { // process filesets
            $project = $this->getProject();

            foreach ($this->filesets as $fs) {
                $ds = $fs->getDirectoryScanner($project);
                $files = $ds->getIncludedFiles();
                $dir = $fs->getDir($this->project)->getPath();

                foreach ($files as $file) {
                    $this->analyze($dir . DIRECTORY_SEPARATOR . $file);
                }
            }
        }

        $this->log("Number of findings: " . $this->counter, Project::MSG_INFO);
    }