Package edu.umd.cs.findbugs

Examples of edu.umd.cs.findbugs.IFindBugsEngine


  @Override
  public boolean work(final String text) {
    try {
      _inspection.registerEventListener(getProject());
      final IFindBugsEngine engine = createFindBugsEngine();
      final FindBugsTask findBugsTask = new FindBugsTask(_project, _bugCollection, "Running FindBugs inspection...", true, engine, true);
      _bugReporter.setFindBugsTask(findBugsTask);
      findBugsTask.runFindBugs(engine);
      return true;
    } catch (final Exception e) {
View Full Code Here


    // Create BugReporter
    _bugReporter = new BugReporter(_project, true, _bugCollection, _findBugsProject);
    _bugReporter.setPriorityThreshold(_userPrefs.getUserDetectorThreshold());

    // Create IFindBugsEngine
    final IFindBugsEngine engine = new FindBugs2();
    engine.setNoClassOk(true);
    engine.setBugReporter(_bugReporter);
    engine.setProject(_findBugsProject);
    engine.setProgressCallback(_bugReporter);

    // add plugins to detector collection
    final DetectorFactoryCollection dfc = FindBugsPreferences.getDetectorFactorCollection();
    engine.setDetectorFactoryCollection(dfc);

    // configure detectors.
    engine.setUserPreferences(_userPrefs);
    return engine;
  }
View Full Code Here


  public boolean work(final String text) {
    try {
      registerEventListener();
      final IFindBugsEngine engine = createFindBugsEngine();
      final FindBugsTask findBugsTask = new FindBugsTask(_project, _bugCollection, text, true, engine, _startInBackground);
      _bugReporter.setFindBugsTask(findBugsTask);
      queue(findBugsTask);

      //_compilerManager = CompilerManager.getInstance(_project);
View Full Code Here

    //final ProjectFilterSettings projectFilterSettings = _userPrefs.getFilterSettings();
    _bugReporter.setPriorityThreshold(_userPrefs.getUserDetectorThreshold());
    //_bugReporter.setPriorityThreshold(projectFilterSettings.getMinPriorityAsInt());

    // Create IFindBugsEngine
    final IFindBugsEngine engine = new FindBugs2();
    engine.setNoClassOk(true);
    engine.setMergeSimilarWarnings(false);
    engine.setBugReporter(_bugReporter);
    engine.setProject(_findBugsProject);
    engine.setProgressCallback(_bugReporter);
    //engine.setScanNestedArchives(true); // todo: prefrences Bean
    //engine.setRelaxedReportingMode(true); // todo: prefrences Bean
    //engine.setRankThreshold(99);
    configureFilter(engine);


    // add plugins to detector collection
    final DetectorFactoryCollection factoryCollection = FindBugsPreferences.getDetectorFactorCollection();
    engine.setDetectorFactoryCollection(factoryCollection);

    //engine.excludeBaselineBugs(_userPrefs.getExcludeBugsFiles());
    // configure detectors.
    engine.setUserPreferences(_userPrefs);
    return engine;
  }
View Full Code Here

    public static BugCollection doAnalysis(@Nonnull Project p, FindBugsProgress progressCallback) throws IOException,
    InterruptedException {
        StringWriter stringWriter = new StringWriter();
        BugCollectionBugReporter pcb = new BugCollectionBugReporter(p, new PrintWriter(stringWriter, true));
        pcb.setPriorityThreshold(Priorities.NORMAL_PRIORITY);
        IFindBugsEngine fb = createEngine(p, pcb);
        fb.setUserPreferences(getUserPreferences());
        fb.setProgressCallback(progressCallback);
        fb.setProjectName(p.getProjectName());

        fb.execute();
        String warnings = stringWriter.toString();
        if (warnings.length() > 0) {
            JTextArea tp = new JTextArea(warnings);
            tp.setEditable(false);
            JScrollPane pane = new JScrollPane(tp);
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.IFindBugsEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.