Examples of DetectorFactory


Examples of edu.umd.cs.findbugs.DetectorFactory

                DetectorNode end = i.next();
                if (factoryChooser.choose(end.getFactory())) {
                    for (Iterator<ConstraintEdge> j = allPassConstraintGraph.incomingEdgeIterator(end); j.hasNext();) {
                        ConstraintEdge edge = j.next();
                        DetectorNode start = edge.getSource();
                        DetectorFactory startFactory = start.getFactory();
                        //
                        // Note that we only enable an otherwise-disabled
                        // detector
                        // if it was the earlier detector in a single-source
                        // constraint.
                        //
                        if (!factoryChooser.choose(startFactory) && edge.isSingleSource()) {
                            factoryChooser.enable(startFactory);
                            change = true;
                            if (DEBUG || FindBugs2.DEBUG) {
                                System.out.println("Dependences force enabling of " + startFactory.getFullName());
                            }
                        }

                    }
                }
View Full Code Here

Examples of edu.umd.cs.findbugs.DetectorFactory

        int passCount = 0;
        for (Iterator<AnalysisPass> i = passList.iterator(); i.hasNext(); ++passCount) {
            System.out.println("Pass " + passCount);
            AnalysisPass pass = i.next();
            for (Iterator<DetectorFactory> j = pass.iterator(); j.hasNext();) {
                DetectorFactory factory = j.next();
                System.out.println("  " + factory.getShortName());
            }
        }
        System.out.println();
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.DetectorFactory

        DetectorFactoryCollection factories = DetectorFactoryCollection.instance();

        // Find all bug patterns reported by at least one non-disabled detector.
        Collection<BugPattern> enabledPatternSet = new HashSet<BugPattern>();
        for (Iterator<DetectorFactory> i = factories.factoryIterator(); i.hasNext();) {
            DetectorFactory factory = i.next();
            if (isEnabled(factory)) {
                enabledPatternSet.addAll(factory.getReportedBugPatterns());
            }
        }

        prologue();
View Full Code Here

Examples of edu.umd.cs.findbugs.DetectorFactory

    private void initDetectorMaps() {

        Iterator<DetectorFactory> iterator = DetectorFactoryCollection.instance().factoryIterator();
        while (iterator.hasNext()) {
            DetectorFactory factory = iterator.next();
            Set<BugPattern> patterns = factory.getReportedBugPatterns();
            for (BugPattern pattern : patterns) {
                Set<DetectorFactory> set = patternToFactory.get(pattern);
                if (set == null) {
                    set = new TreeSet<DetectorFactory>(new Comparator<DetectorFactory>() {
                        public int compare(DetectorFactory f1, DetectorFactory f2) {
                            return f1.getFullName().compareTo(f2.getFullName());
                        }
                    });
                    patternToFactory.put(pattern, set);
                }
                set.add(factory);

                Set<Plugin> pset = patternToPlugin.get(pattern);
                if (pset == null) {
                    pset = new TreeSet<Plugin>(new Comparator<Plugin>() {
                        public int compare(Plugin f1, Plugin f2) {
                            return f1.getPluginId().compareTo(f2.getPluginId());
                        }
                    });
                    patternToPlugin.put(pattern, pset);
                }
                pset.add(factory.getPlugin());
            }
        }
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.DetectorFactory

                widgetSelected(e);
            }

            public void widgetSelected(SelectionEvent e) {
                TableItem item = (TableItem) e.item;
                DetectorFactory factory = (DetectorFactory) item.getData();
                String description = getDetailedText(factory);
                text.setText(description);
            }
        });
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.DetectorFactory

    void refreshUI(UserPreferences preferences) {
        // Enable only those detectors that are enabled by preferences
        TableItem[] itemList = availableFactoriesTableViewer.getTable().getItems();
        for (int i = 0; i < itemList.length; i++) {
            TableItem item = itemList[i];
            DetectorFactory factory = (DetectorFactory) item.getData();
            item.setChecked(preferences.isDetectorEnabled(factory));
        }
        refreshTable();
        syncUserPreferencesWithTable();
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.DetectorFactory

     */
    protected void syncUserPreferencesWithTable() {
        TableItem[] itemList = availableFactoriesTableViewer.getTable().getItems();
        UserPreferences currentProps = getCurrentProps();
        for (int i = 0; i < itemList.length; i++) {
            DetectorFactory factory = (DetectorFactory) itemList[i].getData();
            // set enabled if defined in configuration
            currentProps.enableDetector(factory, itemList[i].getChecked());
        }
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.DetectorFactory

    private void populateAvailableRulesTable(IProject project) {
        List<DetectorFactory> allAvailableList = new ArrayList<DetectorFactory>();
        factoriesToBugAbbrev = new HashMap<DetectorFactory, String>();
        Iterator<DetectorFactory> iterator = DetectorFactoryCollection.instance().factoryIterator();
        while (iterator.hasNext()) {
            DetectorFactory factory = iterator.next();

            // Only configure non-hidden factories
            if (factory.isHidden() && !isHiddenVisible()) {
                continue;
            }

            allAvailableList.add(factory);
            addBugsAbbreviation(factory);
        }

        availableFactoriesTableViewer.setInput(allAvailableList);
        TableItem[] itemList = availableFactoriesTableViewer.getTable().getItems();
        UserPreferences userPreferences = getCurrentProps();
        for (int i = 0; i < itemList.length; i++) {
            DetectorFactory rule = (DetectorFactory) itemList[i].getData();
            // set enabled if defined in configuration
            if (userPreferences.isDetectorEnabled(rule)) {
                itemList[i].setChecked(true);
            }
        }
View Full Code Here

Examples of edu.umd.cs.findbugs.DetectorFactory

        public String getColumnText(Object element, int columnIndex) {

            if (!(element instanceof DetectorFactory)) {
                return null;
            }
            DetectorFactory factory = (DetectorFactory) element;
            COLUMN col = tab.getColumn(columnIndex);

            switch (col) {
            case BUG_CODES:
                return tab.getBugsAbbreviation(factory);
            case DETECTOR_SPEED:
                return factory.getSpeed();
            case PLUGIN:
                String provider = factory.getPlugin().getProvider();
                if(provider == null) {
                    provider = "<unknown>";
                }
                if (provider.endsWith(" project")) {
                    return provider.substring(0, provider.length() - " project".length());
                }
                return provider;
            case BUG_CATEGORIES:
                return tab.getBugsCategories(factory);
            case DETECTOR_NAME:
                return factory.getShortName();
            default:
                return null;
            }
        }
View Full Code Here

Examples of edu.umd.cs.findbugs.DetectorFactory

        }
        return sb.toString();
    }

    private void addDetectorInfo(StringBuilder text) {
        DetectorFactory factory = bug.getDetectorFactory();
        if (factory != null) {
            Plugin plugin = factory.getPlugin();
            if (!plugin.isCorePlugin()) {
                text.append("<p><small><i>Reported by: ").append(factory.getFullName());
                text.append("<br>Contributed by plugin: ").append(plugin.getPluginId());
                text.append("<br>Provider: ").append(plugin.getProvider());
                String website = plugin.getWebsite();
                if (website != null && website.length() > 0) {
                    text.append(" (<a href=\"").append(website).append("\">");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.