package analyses
Common constants and helper methods used by the BugPicker's analyses.
- Alphabetic
- By Inheritance
- analyses
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- case class AnalysisParameters(maxEvalTime: Milliseconds = DefaultMaxEvalTime, maxEvalFactor: Double = DefaultMaxEvalFactor, maxCardinalityOfIntegerRanges: Long = ..., maxCardinalityOfLongSets: Int = DefaultMaxCardinalityOfLongSets, maxCallChainLength: Int = DefaultMaxCallChainLength, fixpointAnalyses: Seq[String] = DefaultFixpointAnalyses) extends Product with Serializable
-
trait
BaseBugPickerAnalysisDomain extends CorrelationalDomain with TheProject with TheMethod with DefaultDomainValueBinding with ThrowAllPotentialExceptionsConfiguration with RefinedTypeLevelFieldAccessInstructions with TypeLevelInvokeInstructions with RefinedTypeLevelInvokeInstructions with SpecialMethodsHandling with DefaultIntegerRangeValues with DefaultLongSetValues with LongSetValuesShiftOperators with DefaultTypeLevelFloatValues with DefaultTypeLevelDoubleValues with ConcretePrimitiveValuesConversions with NullPropertyRefinement with MaxArrayLengthRefinement with DefaultHandlingOfMethodResults with IgnoreSynchronization
The base domain that is shared by all domains that are used to perform abstract interpretations of methods.
-
trait
BasePerformInvocationBugPickerAnalysisDomain extends BaseBugPickerAnalysisDomain with PerformInvocationsWithRecursionDetection with PerformInvocationsWithBasicVirtualMethodCallResolution with DefaultClassValuesBinding
The base domain that is shared by all domains that are used to perform abstract interpretations of methods where methods are potentially called.
-
class
BugPickerAnalysis extends Analysis[URL, BugPickerResults]
Wrapper around several analyses that analyze the control- and data-flow to identify various issues in the source code of projects.
Wrapper around several analyses that analyze the control- and data-flow to identify various issues in the source code of projects.
Precision
The analyses are designed such that they try to avoid to report false positives to facilitate usage of the BugPicker. However, given that we analyze Java bytecode, some findings may be the result of the compilation scheme employed by the compiler and, hence, cannot be resolved at the source code level. This is in particular true for finally blocks in Java programs. In this case compilers typically include the same block two (or more) times in the code. Furthermore, Java reflection and reflection-like mechanisms are also a source of false positives.
- type BugPickerResults = (Nanoseconds, Iterable[Issue], Iterable[AnalysisException])
-
class
FallbackBugPickerAnalysisDomain extends BaseBugPickerAnalysisDomain with DefaultClassValuesBinding with RecordAllThrownExceptions with RecordCFG with RecordDefUse
This is the fall back domain that is used to perform an abstract interpretation of a method without invoking called methods.
- class InvocationBugPickerAnalysisDomain extends BasePerformInvocationBugPickerAnalysisDomain with RecordMethodCallResults with RecordLastReturnedValues with RecordAllThrownExceptions with ChildPerformInvocationsWithRecursionDetection
-
class
RootBugPickerAnalysisDomain extends BasePerformInvocationBugPickerAnalysisDomain with TheAI[BaseBugPickerAnalysisDomain] with TheMemoryLayout with RecordAllThrownExceptions with RecordCFG with RecordDefUse
The domain that is used to identify the issues.
Value Members
- final val AssertionError: ObjectType
- final val ObjectEqualsMethodDescriptor: MethodDescriptor
- final val ObjectHashCodeMethodDescriptor: MethodDescriptor
-
object
AnonymousInnerClassShouldBeStatic
This analysis reports anonymous inner classes that do not use their reference to the parent class and as such could be made
staticin order to save some memory and to improve overall comprehension.This analysis reports anonymous inner classes that do not use their reference to the parent class and as such could be made
staticin order to save some memory and to improve overall comprehension.Since anonymous inner classes cannot be declared
static, they must be refactored to named inner classes first. -
object
BugPickerAnalysis
Common constants and helper methods related to the configuration of the BugPicker and generating reports.
-
object
CollectionsUsage
Identifies cases where the collections API is not used as intended.
-
object
CovariantEquals
This analysis reports classes that have some
equals()method(s), but notequals(Object).This analysis reports classes that have some
equals()method(s), but notequals(Object). This is bad practice and can lead to unexpected behavior, because without anequals(Object)method,Object.equals(Object)is not properly overridden. However, the relevance is determined by the presence of a hashCode method. -
object
DeadEdgesAnalysis
Identifies dead edges in code.
-
object
GuardedAndUnguardedAccessAnalysis
Identifies accesses to local reference variables that are once done in a guarded context (w.r.t.
Identifies accesses to local reference variables that are once done in a guarded context (w.r.t. its nullness property; guarded by an if instruction) and that are also done in an unguarded context.
This is only a very shallow analysis that is subject to false positives; to filter potential false positives we filter all those issues where we can identify a control and data-dependency to a derived value. E.g.,
def printSize(f : File) : Unit = { val name = if(f eq null) null else f.getName if(name == null) throw new NullPointerException; // here... f is not null; because if f is null at the beginning, name would be null to // and the method call would have returned abnormally (raised a NullPointerException). println(f.size) }
-
object
ManualGarbageCollection
This analysis reports calls to
java.lang.System/Runtime.gc()that seem to be made manually in code outside the core of the JRE.This analysis reports calls to
java.lang.System/Runtime.gc()that seem to be made manually in code outside the core of the JRE.Manual invocations of garbage collection are usually unnecessary and can lead to performance problems. This heuristic tries to detect such cases.
-
object
ThrowsExceptionAnalysis
This analysis identifies those instructions (except of ATHROW) that always lead to an exception.
-
object
UnusedFields
Identifies fields (static or instance) that are not used and which are also not useable.
-
object
UnusedLocalVariables
Identifies unused local variables in non-synthetic methods.
-
object
UnusedMethodsAnalysis
Identifies unused methods and constructors using the given call graph.
-
object
UselessComputationsAnalysis
Identifies computations that are useless (i.e., computations that could be done in the source code.)
-
object
UselessReComputationsAnalysis
Identifies computations of primitive values that lead to the same result as a previous computation.
Identifies computations of primitive values that lead to the same result as a previous computation. Such computations (which could be a constant expression) are generally useless and hinder code comprehension.