module lang::php::stats::Stats
Usage
import lang::php::stats::Stats;
Source code
http://github.com/cwi-swat/php-analysis/blob/main/src/main/rascal/lang/php/stats/Stats.rsc
Dependencies
import lang::php::util::Utils;
import lang::php::ast::AbstractSyntax;
import lang::php::util::Corpus;
import lang::php::ast::System;
import lang::php::util::Config;
import Set;
import String;
import List;
import IO;
import ValueIO;
import lang::csv::IO;
function containsVV
bool containsVV(Expr e)
bool containsVV(someExpr(Expr e))
bool containsVV(noExpr())
function gatherExprStats
lrel[loc fileloc, Expr call] gatherExprStats(System scripts, list[Expr](Script) f)
function fetchClassConstUses
list[Expr] fetchClassConstUses(Script scr)
Gather information on uses of class constants where the class name is given using a variable-variable
function fetchClassConstUsesVVTarget
list[Expr] fetchClassConstUsesVVTarget(Script scr)
function gatherVVClassConsts
lrel[loc fileloc, Expr call] gatherVVClassConsts(System scripts)
function fetchAssignUses
list[Expr] fetchAssignUses(Script scr)
Gather information on assignments where the assignment target contains a variable-variable
function fetchAssignUsesVVTarget
list[Expr] fetchAssignUsesVVTarget(Script scr)
function gatherVVAssigns
lrel[loc fileloc, Expr call] gatherVVAssigns(System scripts)
function fetchAssignWOpUses
list[Expr] fetchAssignWOpUses(Script scr)
Gather information on assignment/op combos where the assignment target contains a variable-variable
function fetchAssignWOpUsesVVTarget
list[Expr] fetchAssignWOpUsesVVTarget(Script scr)
function gatherVVAssignWOps
lrel[loc fileloc, Expr call] gatherVVAssignWOps(System scripts)
function fetchListAssignUses
list[Expr] fetchListAssignUses(Script scr)
Gather information on list assignments where the assignment target contains a variable-variable
function fetchListAssignUsesVVTarget
list[Expr] fetchListAssignUsesVVTarget(Script scr)
function gatherVVListAssigns
lrel[loc fileloc, Expr call] gatherVVListAssigns(System scripts)
function fetchRefAssignUses
list[Expr] fetchRefAssignUses(Script scr)
Gather information on reference assignments where the assignment target contains a variable-variable
function fetchRefAssignUsesVVTarget
list[Expr] fetchRefAssignUsesVVTarget(Script scr)
function gatherVVRefAssigns
lrel[loc fileloc, Expr call] gatherVVRefAssigns(System scripts)
function fetchNewUses
list[Expr] fetchNewUses(Script scr)
Gather information on object creations with variable class names
function fetchNewUsesVVClass
list[Expr] fetchNewUsesVVClass(Script scr)
function gatherVVNews
lrel[loc fileloc, Expr call] gatherVVNews(System scripts)
function fetchCallUses
list[Expr] fetchCallUses(Script scr)
Gather information on calls where the function to call is given through a variable-variable
function fetchCallUsesVVName
list[Expr] fetchCallUsesVVName(Script scr)
function gatherVVCalls
lrel[loc fileloc, Expr call] gatherVVCalls(System scripts)
function fetchMethodCallUses
list[Expr] fetchMethodCallUses(Script scr)
Gather information on method calls where the method to call is given through a variable-variable
function fetchMethodCallUsesVVTarget
list[Expr] fetchMethodCallUsesVVTarget(Script scr)
function gatherMethodVVCalls
lrel[loc fileloc, Expr call] gatherMethodVVCalls(System scripts)
function fetchStaticCallUses
list[Expr] fetchStaticCallUses(Script scr)
Gather information on static calls where the static class and/or the static method is given as a variable-variable
function fetchStaticCallUsesVVMethod
list[Expr] fetchStaticCallUsesVVMethod(Script scr)
function fetchStaticCallUsesVVTarget
list[Expr] fetchStaticCallUsesVVTarget(Script scr)
function gatherStaticVVCalls
lrel[loc fileloc, Expr call] gatherStaticVVCalls(System scripts)
function gatherStaticVVTargets
lrel[loc fileloc, Expr call] gatherStaticVVTargets(System scripts)
function fetchIncludeUses
list[Expr] fetchIncludeUses(Script scr)
Gather information on includes with paths based on expressions
function fetchIncludeUsesVarPaths
list[Expr] fetchIncludeUsesVarPaths(Script scr)
function gatherIncludesWithVarPaths
lrel[loc fileloc, Expr call] gatherIncludesWithVarPaths(System scripts)
function fetchPropertyFetchUses
list[Expr] fetchPropertyFetchUses(Script scr)
Gather information on property fetch expressions with the property name given as a variable-variable
function fetchPropertyFetchVVNames
list[Expr] fetchPropertyFetchVVNames(Script scr)
function gatherPropertyFetchesWithVarNames
lrel[loc fileloc, Expr call] gatherPropertyFetchesWithVarNames(System scripts)
function staticPropertyFetchUses
list[Expr] staticPropertyFetchUses(Script scr)
Gather information on static property fetches where the static class and/or the static property name is given as a variable-variable
function staticPropertyFetchVVName
list[Expr] staticPropertyFetchVVName(Script scr)
function staticPropertyFetchVVTarget
list[Expr] staticPropertyFetchVVTarget(Script scr)
function gatherStaticPropertyVVNames
lrel[loc fileloc, Expr call] gatherStaticPropertyVVNames(System scripts)
function gatherStaticPropertyVVTargets
lrel[loc fileloc, Expr call] gatherStaticPropertyVVTargets(System scripts)
function fetchVarUses
list[Expr] fetchVarUses(Script scr)
Gather variable-variable uses
function fetchVarUsesVV
list[Expr] fetchVarUsesVV(Script scr)
function gatherVarVarUses
lrel[loc fileloc, Expr call] gatherVarVarUses(System scripts)
function fetchOverloadedSet
list[ClassItem] fetchOverloadedSet(System scripts)
Magic methods that implement overloads
function fetchOverloadedGet
list[ClassItem] fetchOverloadedGet(System scripts)
function fetchOverloadedIsSet
list[ClassItem] fetchOverloadedIsSet(System scripts)
function fetchOverloadedUnset
list[ClassItem] fetchOverloadedUnset(System scripts)
function fetchOverloadedCall
list[ClassItem] fetchOverloadedCall(System scripts)
function fetchOverloadedCallStatic
list[ClassItem] fetchOverloadedCallStatic(System scripts)
function fetchVACalls
list[Expr] fetchVACalls(Script scr)
Support for var-args functions
function getVACallUses
lrel[loc fileloc, Expr call] getVACallUses(System scripts)
function fetchVarBreak
list[Stmt] fetchVarBreak(System scripts)
Break/continue with non-literal arguments
function fetchVarContinue
list[Stmt] fetchVarContinue(System scripts)
function fetchEvalUses
list[Expr] fetchEvalUses(Script scr)
Uses of eval
function gatherEvals
lrel[loc fileloc, Expr call] gatherEvals(System scripts)
function featureCounts
map[str,int] featureCounts(System scripts)
function stmtCounts
map[str,int] stmtCounts(System scripts)
Gather statement counts
function stmtAndExprCountsByFile
map[str file, map[str feature, int count] counts] stmtAndExprCountsByFile(System scripts)
function exprCounts
map[str,int] exprCounts(System scripts)
Gather expression counts
function getExprKey
str getExprKey(Expr::array(_,_))
str getExprKey(fetchArrayDim(_,_))
str getExprKey(fetchClassConst(_,_))
str getExprKey(assign(_,_))
str getExprKey(assignWOp(_,_,Op op))
str getExprKey(listAssign(_,_))
str getExprKey(refAssign(_,_))
str getExprKey(binaryOperation(_,_,Op op))
str getExprKey(unaryOperation(_,Op op))
str getExprKey(new(_,_))
str getExprKey(cast(CastType ct,_))
str getExprKey(clone(_))
str getExprKey(closure(_,_,_,_,_,_,_))
str getExprKey(fetchConst(_))
str getExprKey(empty(_))
str getExprKey(suppress(_))
str getExprKey(eval(_))
str getExprKey(exit(_,_))
str getExprKey(call(_,_))
str getExprKey(methodCall(_,_,_,_))
str getExprKey(staticCall(_,_,_))
str getExprKey(Expr::include(_,_))
str getExprKey(instanceOf(_,_))
str getExprKey(isSet(_))
str getExprKey(print(_))
str getExprKey(propertyFetch(_,_,_))
str getExprKey(shellExec(_))
str getExprKey(ternary(_,_,_))
str getExprKey(staticPropertyFetch(_,_))
str getExprKey(scalar(_))
str getExprKey(var(_))
str getExprKey(listExpr(_))
str getExprKey(\throw(_))
default str getExprKey(Expr e)
function exprKeyOrder
list[str] exprKeyOrder()
function getOpKey
str getOpKey(bitwiseAnd())
str getOpKey(bitwiseOr())
str getOpKey(bitwiseXor())
str getOpKey(Op::concat())
str getOpKey(div())
str getOpKey(minus())
str getOpKey(\mod())
str getOpKey(mul())
str getOpKey(plus())
str getOpKey(rightShift())
str getOpKey(leftShift())
str getOpKey(booleanAnd())
str getOpKey(booleanOr())
str getOpKey(booleanNot())
str getOpKey(bitwiseNot())
str getOpKey(gt())
str getOpKey(geq())
str getOpKey(logicalAnd())
str getOpKey(logicalOr())
str getOpKey(logicalXor())
str getOpKey(notEqual())
str getOpKey(notIdentical())
str getOpKey(postDec())
str getOpKey(preDec())
str getOpKey(postInc())
str getOpKey(preInc())
str getOpKey(lt())
str getOpKey(leq())
str getOpKey(unaryPlus())
str getOpKey(unaryMinus())
str getOpKey(equal())
str getOpKey(identical())
function opKeyOrder
list[str] opKeyOrder()
function binOpOrder
list[str] binOpOrder()
function uOpOrder
list[str] uOpOrder()
function opKeyAssnOrder
list[str] opKeyAssnOrder()
function getCastTypeKey
str getCastTypeKey(\int())
str getCastTypeKey(\bool())
str getCastTypeKey(CastType::float())
str getCastTypeKey(CastType::string())
str getCastTypeKey(CastType::array())
str getCastTypeKey(object())
str getCastTypeKey(CastType::unset())
function castTypeOrder
list[str] castTypeOrder()
function getStmtKey
str getStmtKey(\break(_))
str getStmtKey(classDef(_))
str getStmtKey(Stmt::const(_))
str getStmtKey(\continue(_))
str getStmtKey(declare(_,_))
str getStmtKey(do(_,_))
str getStmtKey(echo(_))
str getStmtKey(exprstmt(_))
str getStmtKey(\for(_,_,_,_))
str getStmtKey(foreach(_,_,_,_,_))
str getStmtKey(function(_,_,_,_,_,_))
str getStmtKey(global(_))
str getStmtKey(goto(_))
str getStmtKey(haltCompiler(_))
str getStmtKey(\if(_,_,_,_))
str getStmtKey(inlineHTML(_))
str getStmtKey(interfaceDef(_))
str getStmtKey(traitDef(_))
str getStmtKey(label(_))
str getStmtKey(namespace(_,_))
str getStmtKey(\return(_))
str getStmtKey(Stmt::static(_))
str getStmtKey(\switch(_,_))
str getStmtKey(tryCatch(_,_))
str getStmtKey(Stmt::unset(_))
str getStmtKey(Stmt::useStmt(_,_,_))
str getStmtKey(\while(_,_))
function stmtKeyOrder
list[str] stmtKeyOrder()
function getClassItemKey
str getClassItemKey(ClassItem::property(set[Modifier] modifiers, list[Property] prop, PHPType ptype, _))
str getClassItemKey(ClassItem::constCI(list[Const] consts, set[Modifier] modifiers, _))
str getClassItemKey(ClassItem::method(str name, set[Modifier] modifiers, bool byRef, list[Param] params, list[Stmt] body, PHPType returnType, _))
str getClassItemKey(ClassItem::traitUse(list[Name] traits, list[Adaptation] adaptations))
function classItemKeyOrder
list[str] classItemKeyOrder()
function featureOrder
list[str] featureOrder()
function rascalFriendlyKey
str rascalFriendlyKey(str k)
function gatherFeatureCountsFromBinary
void gatherFeatureCountsFromBinary(str product, str version)
function buildFeatureCounts
void buildFeatureCounts(str product, str version)
void buildFeatureCounts(str product)
void buildFeatureCounts()
function gatherStatsFromBinary
void gatherStatsFromBinary(str product, str version)
function buildStats
void buildStats(str product, str version)
void buildStats(str product)
void buildStats()
function writeFeatureCounts
void writeFeatureCounts(str product, str version, map[str,int] fc)
function writeStats
void writeStats(str product, str version, map[str,int] fc, map[str,int] sc, map[str,int] ec)
function getStats
tuple[map[str,int] fc, map[str,int] sc, map[str,int] ec] getStats(str product, str version)
map[tuple[str,str],tuple[map[str,int] fc, map[str,int] sc, map[str,int] ec]] getStats(str product)
map[tuple[str,str],tuple[map[str,int] fc, map[str,int] sc, map[str,int] ec]] getStats()
function getSortedStats
list[tuple[str p, str v, map[str,int] fc, map[str,int] sc, map[str,int] ec]] getSortedStats()
function loadVersionsCSV
rel[str Product,str Version,str ReleaseDate,str RequiredPHPVersion,str Comments] loadVersionsCSV()
function loadCountsCSV
rel[str Product,str Version,int Count,int FileCount] loadCountsCSV(loc csvLoc = |project://PHPAnalysis/src/lang/php/extract/csvs/linesOfCode.csv|)
function getLatestVersionsByDate
map[str Product, str Version] getLatestVersionsByDate()
function getLatestPHP4VersionsByDate
map[str Product, str Version] getLatestPHP4VersionsByDate()
function getLatestPHP5VersionsByDate
map[str Product, str Version] getLatestPHP5VersionsByDate()
function getPHPVersion
str getPHPVersion(str product, str version)
function getReleaseDate
str getReleaseDate(str product, str version)
function loadProductInfoCSV
rel[str Product,str PlainText,str Description] loadProductInfoCSV()