Skip to content

Commit

Permalink
Removed doubly-defined function that was unused
Browse files Browse the repository at this point in the history
  • Loading branch information
rodinaarssen committed Oct 31, 2024
1 parent 1e51545 commit fc7b70c
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/main/rascal/lang/php/stats/Unfriendly.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -1165,16 +1165,6 @@ public str groupsTable() = groupsTable({},{},{});
public list[str] getFeatureLabels() = [ l | \map(_,rtype) := #FMap.symbol, /Type::label(l,_) := rtype ];
public void checkGroups() {
labels = getFeatureLabels();
groups = getFeatureGroups();
//keys = [rascalFriendlyKey(k) | k <- (exprKeyOrder()+stmtKeyOrder())];
missing = {*labels} - {*groups[g] | g <- groups};
extra = {*groups[g] | g <- groups} - {*labels};
for (m <- missing) println("Missing: <m>");
for (e <- extra) println("Extra: <e>");
}
public str generalFeatureSquiglies(FMap featsMap) {
labels = getFeatureLabels();
groups = getFeatureGroups();
Expand Down Expand Up @@ -1419,27 +1409,6 @@ public FeatureLattice calculateTransitiveFiles(FeatureLattice lattice, FeatureNo
return lattice;
}

public void checkGroups() {
labels = [ l | \map(_,rtype) := #FMap.symbol, /Type::label(l,_) := rtype ];
groups = ("binary ops" : [ l | str l:/^binaryOp.*/ <- labels ])
+ ("unary ops" : [l | str l:/^unaryOp.*/ <- labels ])
+ ("control flow" : ["break","continue","declare","do","for","foreach","goto","if","return","switch","throw","tryCatch","while","exit","suppress","label"])
+ ("assignment ops" : [l | str l:/^assign.*/ <-labels] + ["listAssign","refAssign", "unset"])
+ ("definitions" : ["functionDef","interfaceDef","traitDef","classDef","namespace","global","static","const","use","include","closure"])
+ ("invocations" : ["call","methodCall","staticCall", "eval", "shellExec"])
+ ("allocations" : ["array","new","scalar", "clone"])
+ ("casts" : [l | str l:/^cast.*/ <- labels])
+ ("print" : ["print","echo","inlineHTML" ])
+ ("predicates" : ["isSet","empty","instanceOf"])
+ ("lookups" : ["fetchArrayDim","fetchClassConst","var","classConst","fetchConst","propertyFetch","fetchStaticProperty"])
;
keys = [rascalFriendlyKey(k) | k <- (exprKeyOrder()+stmtKeyOrder())];
missing = toSet(keys) - {*g|g<-groups<1>};
extra = {*g|g<-groups<1>} - toSet(keys);
for (m <- missing) println("Missing: <m>");
for (e <- extra) println("Extra: <e>");
}
public tuple[set[FeatureNode],set[str],int] minimumFeaturesForPercent(FMap fmap, FeatureLattice lattice, int targetPercent) {
println("Calculating coverage needed for <targetPercent>%");

Expand Down

1 comment on commit fc7b70c

@mahills
Copy link
Member

@mahills mahills commented on fc7b70c Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file probably needs a lot of cleanup, so I'll take a look at it. We shifted away from doing things this way -- this was from the 2013 paper where we were looking at finding "unfriendly" features for analysis tools (hence the module name).

Please sign in to comment.