Package org.openquark.cal.filter

Examples of org.openquark.cal.filter.AcceptAllQualifiedNamesFilter


        assertFalse(functionFlagged("notAlias6", LintWarning.WarningType.MISMATCHED_ALIAS_PLINGS, warningList));
    }
   
    /** Test the detection of unreferenced let variables */
    public void testUnreferencedLetVariableDetection() {
        List<LintWarning> warningList = SourceMetricFinder.computeLintWarnings(moduleDefn, moduleTypeInfo, new AcceptAllQualifiedNamesFilter(), false, false, false, false, false, true);
       
        assertTrue(functionFlagged("unusedLetVars1", LintWarning.WarningType.UNREFERENCED_LET_VARIABLE, warningList));
        assertTrue(functionFlagged("unusedLetVars2", LintWarning.WarningType.UNREFERENCED_LET_VARIABLE, warningList));
        assertTrue(functionFlagged("unusedLetVars3", LintWarning.WarningType.UNREFERENCED_LET_VARIABLE, warningList));
        assertTrue(functionFlagged("unusedLetVars4", LintWarning.WarningType.UNREFERENCED_LET_VARIABLE, warningList));
View Full Code Here


        assertFalse(functionFlagged("usesLetVar5", LintWarning.WarningType.UNREFERENCED_LET_VARIABLE, warningList));
    }
   
    /** Test that SourcePositions are correctly recorded for all warning types */
    public void testSourcePositions() {
        List<LintWarning> warningList = SourceMetricFinder.computeLintWarnings(moduleDefn, moduleTypeInfo, new AcceptAllQualifiedNamesFilter(), false, true, true, false, false, false);
        LintWarning[] veryLintyWarnings = new LintWarning[3];
       
        int i = 0;
        for(Iterator<LintWarning> it = warningList.iterator(); it.hasNext() && i < 3;) {
            LintWarning warning = it.next();
View Full Code Here

        assertEquals(veryLintyWarnings[0].getSourcePosition().getColumn(), veryLintyWarnings[2].getSourcePosition().getColumn());
    }
   
    /** Test that warning filtering is working */
    public void testWarningTypeFilter() {
        List<LintWarning> lambdasOnlyList = SourceMetricFinder.computeLintWarnings(moduleDefn, moduleTypeInfo, new AcceptAllQualifiedNamesFilter(), false, false, true, false, false, false);
        List<LintWarning> plingsOnlyList = SourceMetricFinder.computeLintWarnings(moduleDefn, moduleTypeInfo, new AcceptAllQualifiedNamesFilter(), false, true, false, false, false, false);

        assertTrue(lambdasOnlyList.size() > 0);

        for (final LintWarning warning : lambdasOnlyList) {
            assertTrue(warning.getWarningType() == LintWarning.WarningType.REDUNDANT_LAMBDA);
View Full Code Here

        }
    }
   
    /** Test that function regular expression filtering is working */
    public void testLintWalkerRegexpFiltering() {
        List<LintWarning> unfilteredWarningsList = SourceMetricFinder.computeLintWarnings(moduleDefn, moduleTypeInfo, new AcceptAllQualifiedNamesFilter(), false, true, false, false, false, false);
        List<LintWarning> filteredWarningsList = SourceMetricFinder.computeLintWarnings(moduleDefn, moduleTypeInfo, new RegExpBasedUnqualifiedNameFilter("very.*", true), false, true, false, false, false, false);

        assertTrue(functionFlagged("veryLintyFunction", LintWarning.WarningType.UNPLINGED_PRIMITIVE_ARG, unfilteredWarningsList));
        assertFalse(functionFlagged("veryLintyFunction", LintWarning.WarningType.UNPLINGED_PRIMITIVE_ARG, filteredWarningsList));
    }
View Full Code Here

     * @param moduleTypeInfo The typeinfo object for the module specified by moduleSourceDefn
     */
    static void updateRawMetricData(SourceModel.ModuleDefn moduleDefn, ModuleTypeInfo moduleTypeInfo) {

        // Compute the set of references from this module
        ReferenceFrequencyFinder finder = new ReferenceFrequencyFinder(moduleTypeInfo, new AcceptAllQualifiedNamesFilter(), false);
        finder.visit_ModuleDefn(moduleDefn, null);
        Map<Pair<QualifiedName, QualifiedName>, Integer> dependeeMap = finder.getDependeeMap();
       
        // Add each reference to the appropriate Function
        for (final Map.Entry<Pair<QualifiedName, QualifiedName>, Integer> entry : dependeeMap.entrySet()) {
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return dumpReferenceFrequencies(new AcceptAllModulesFilter(), new AcceptAllQualifiedNamesFilter(), false);
    }
View Full Code Here

             
              QualifiedNameFilter functionFilter;
              if (chooser.shouldExcludeFunctionsByRegexp()) {
                  functionFilter = new RegExpBasedUnqualifiedNameFilter(chooser.getExcludeFunctionsRegexp(), true);
              } else {
                  functionFilter = new AcceptAllQualifiedNamesFilter();
              }
             
              try {
                  FileOutputStream fos = new FileOutputStream(chooser.getSelectedFile());
                  PrintStream ps = new PrintStream(fos);
View Full Code Here

             
              QualifiedNameFilter functionFilter;
              if (chooser.shouldExcludeFunctionsByRegexp()) {
                  functionFilter = new RegExpBasedUnqualifiedNameFilter(chooser.getExcludeFunctionsRegexp(), true);
              } else {
                  functionFilter = new AcceptAllQualifiedNamesFilter();
              }
             
              try {
                  FileOutputStream fos = new FileOutputStream(chooser.getSelectedFile());
                  PrintStream ps = new PrintStream(fos);
View Full Code Here

               
                QualifiedNameFilter functionFilter;
                if (chooser.shouldExcludeFunctionsByRegexp()) {
                    functionFilter = new RegExpBasedUnqualifiedNameFilter(chooser.getExcludeFunctionsRegexp(), true);
                } else {
                    functionFilter = new AcceptAllQualifiedNamesFilter();
                }
               
                if(chooser.getOkSelected()) {
                    chooser.savePreferences();
                    System.out.println("Dumping lint warnings:");
View Full Code Here

TOP

Related Classes of org.openquark.cal.filter.AcceptAllQualifiedNamesFilter

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.