Releases: integrated-application-development/sonar-delphi
Releases · integrated-application-development/sonar-delphi
1.17.0
Added
- Support for the
AtomicCmpExchange128
intrinsic routine. - Support for the
GetTypeKind
intrinsic routine. - Support for the
OpenString
intrinsic type. - API:
TypeParameterNode::getTypeParameters
method. - API:
InterfaceTypeNode::getGuidExpression
method. - API:
AttributeNode::getExpression
method.
Changed
- Issue locations no longer span the entire routine declaration in
RoutineName
. - Improve type modeling around the
VarArg*
intrinsic routines.
Deprecated
- API:
InterfaceGuidNode
node type. - API:
InterfaceTypeNode::getGuid
method, usegetGuidExpression
instead. - API:
DelphiTokenType.GUID
, as the associatedInterfaceGuidNode
is no longer parsed.
Fixed
- Name resolution failures on generic routine invocations where later type parameters are constrained by earlier type parameters.
- Type resolution failures on property attribute lists.
- Type resolution failures on implementation-local routine attribute lists.
- Type resolution failures on
as
casts where the type is returned from a routine invocation. - Inaccurate type resolution when calling a constructor on a class reference type.
- Grammar ambiguity causing attributes to be misinterpreted as interface GUIDs.
- Failure to resolve invocations of
System.IsManagedType
where a value is passed.
1.16.0
Added
- Support for MSBuild item and item metadata expressions in project files.
- Debug logging for name resolution failures (enabled with
sonar-scanner -X
). ExhaustiveEnumCase
analysis rule, which flagscase
statements that do not handle all values in an enumeration.IterationPastHighBound
analysis rule, which flagsfor
loops that iterate past the end of the collection.ExplicitBitwiseNot
analysis rule, which flags potentially incorrect bitwisenot
operations.- API:
EnumeratorOccurrence
type. - API:
ForInStatementNode::getEnumeratorOccurrence
method. - API:
TypeOfTypeNode::getTypeReferenceNode
method. - API:
NameReferenceNode::getFirstName
method. - API:
DelphiTokenType.TYPE_CONSTRAINT
token type. - API:
ConstraintNode
node type. - API:
ClassConstraintNode
node type. - API:
ConstructorConstraintNode
node type. - API:
RecordConstraintNode
node type. - API:
TypeConstraintNode
node type. - API:
TypeParameterNode::getConstraintNodes
method. - API:
TypeParameterType::constraintItems
method. - API:
Constraint
type. - API:
Constraint.ClassConstraint
type. - API:
Constraint.ConstructorConstraint
type. - API:
Constraint.RecordConstraint
type. - API:
Constraint.TypeConstraint
type.
Changed
- Detect tab-indented multiline strings in
TabulationCharacter
. - Improve support for evaluating name references in compiler directive expressions.
- Improve overload resolution in cases involving generic type parameter constraints.
- Improve handling for MSBuild properties, items, and conditional evaluation.
- Perform best-effort name resolution of arguments to unresolved routines or array properties, which improves analysis quality in cases where symbol information is incomplete.
Deprecated
- API:
ForInStatementNode::getGetEnumeratorDeclaration
method, get the declaration throughgetEnumeratorOccurrence
instead. - API:
ForInStatementNode::getMoveNextDeclaration
method, get the declaration throughgetEnumeratorOccurrence
instead. - API:
ForInStatementNode::getCurrentDeclaration
method, get the declaration throughgetEnumeratorOccurrence
instead. - API:
TypeParameterNode::getTypeConstraintNodes
method, usegetConstraintNodes
instead. - API:
TypeParameterType::constraints
method, useconstraintItems
instead.
Fixed
- False positives on enumerable method
GetEnumerator
inUnusedRoutine
. - False positives on enumerator method
MoveNext
inUnusedRoutine
. - False positives on enumerator property
Current
inUnusedProperty
. - False positives on enums that are never referenced by name (but have used values) in
UnusedType
. - Name resolution failures in legacy initialization sections referencing the implementation section.
- Name resolution failures when accessing ancestors of enclosing types from nested type methods.
- Name resolution failures on invocations of methods with generic open array parameters.
- Name resolution failures around
Create
calls on types withconstructor
constraints. - Name resolution failures on
read
,write
, andstored
specifiers of indexed properties. - Name resolution failures on routine references assigned to a
var
/const
declaration. - Name resolution failures on routine references in constant arrays.
- Type resolution failures on array expressions nested within multidimensional constant arrays.
- Incorrect file position calculation for multiline string tokens.
- Analysis errors around
type of
type declarations.
1.15.0
Added
ParsingError
analysis rule, which flags files where parsing failures occurred.- Support for the
WEAK_NATIVEINT
symbol, which is defined from Delphi 12 onward. - Support for undocumented intrinsics usable within
varargs
routines:VarArgStart
VarArgGetValue
VarArgCopy
VarArgEnd
Changed
- Exclude types annotated with attributes in
UnusedType
. - Improve reporting of parsing failures occurring within include files.
- Improve reporting of parsing failures occurring within compiler directives.
Deprecated
- API:
SwitchDirective.SwitchKind.TYPEADDRESS
enum member, useTYPEDADDRESS
instead.
Fixed
- Exceptions from empty structures (e.g.,
if
) inLoopExecutingAtMostOnce
andRedundantJump
. - False positives from case statements in
LoopExecutingAtMostOnce
. - False positives from nested finally-except blocks in
RedundantJump
. - False positives around wrapped type declarations in
VisibilityKeywordIndentation
. - False negatives around inline
var
andconst
inPlatformDependentTruncation
. - Trailing whitespace within comments not recognized in
TrailingWhitespace
. - Overload resolution failures on the variant overload of the
Copy
intrinsic. - Several compiler directives were not being recognized:
E
F
K
N
S
ALLOWBIND
ALLOWISOLATION
HIGHENTROPYVA
HIGHCHARUNICODE
LARGEADDRESSAWARE
MAXPAGESIZE
NXCOMPAT
SONAME
SOPREFIX
SOSUFFIX
SOVERSION
STACKCHECKS
STRINGCHECKS
TSAWARE
TYPEDADDRESS
1.14.1
Fixed
- File pointer errors around
>=
and<=
tokens.
1.14.0
Added
RedundantJump
analysis rule, which flags redundant jump statements, e.g.,Continue
,Exit
.LoopExecutingAtMostOnce
analysis rule, which flags loop statements that can execute at most once.excludedNames
rule property to theMixedNames
rule.- API:
RepeatStatementNode::getGuardExpression
method. - API:
RepeatStatementNode::getStatementList
method. - API:
CaseStatementNode::getSelectorExpression
method. - API:
CaseItemStatementNode::getStatement
method.
Fixed
- Parsing errors where adjacent
>
and=
tokens were wrongly interpreted as the>=
operator. - False-positives within assignment statements in
IndexLastListElement
.
1.13.0
Added
- API:
AnonymousMethodNode::getDeclarationSection
method. - API:
AnonymousMethodNode::getStatementBlock
method. - API:
AnonymousMethodNode::isEmpty
method.
Changed
- Include the global browsing path in unit import resolution.
- Reprioritize the analysis search path in the following order (highest to lowest):
- Referenced project files (
DCCReference
) - Search path (
DCC_UnitSearchPath
) - Debugger source path (
Debugger_DebugSourcePath
) - Library path (
DelphiLibraryPath
/DelphiTranslatedLibraryPath
) - Browsing path (
DelphiBrowsingPath
) - Standard library
- Analysis source files (
sonar.sources
)
- Referenced project files (
- Empty anonymous methods are now ignored in
EmptyBlock
. - Empty anonymous methods are now flagged in
EmptyRoutine
.
1.12.2
Fixed
- Incorrect case-sensitive treatment of file names in coverage reports.
1.12.1
Fixed
- Various intrinsic routines had incorrect signatures around dynamic and open arrays.
- False positives around platform-dependent binary expressions in
PlatformDependentTruncation
. - Incorrect type resolution around array property accesses.
1.12.0
Added
- API:
DelphiCheckContext::getUri
method.
Fixed
- Parsing errors on semicolon-delimited generic type parameters in routine implementation headers.
- Incorrect return types for
Length
,High
, andLow
on open/dynamic arrays depending on the compiler version and toolchain. - Name resolution failures on explicit references to default array properties with overloads on ancestor types.
1.11.0
Added
MissingRaise
analysis rule, which flags exception constructions for whichraise
has been omitted.- API:
ProceduralType::directives
method. - API:
ProceduralTypeNode::getDirectives
method. - API:
ProceduralTypeNode::hasDirective
method. - API:
ProceduralTypeHeadingNode::getDirectives
method. - API:
AnonymousMethodNode::getAnonymousMethodHeading
method. - API:
AnonymousMethodNode::getDirectives
method. - API:
AnonymousMethodNode::hasDirective
method. - API:
AnonymousMethodHeadingNode
node type. - API:
DelphiTokenType.ANONYMOUS_METHOD
token type. - API:
DelphiTokenType.ANONYMOUS_METHOD_HEADING
token type.
Fixed
- Parsing errors on
implementation
keywords nested in conditional branches. - Parsing errors on anonymous methods with routine directives (like calling conventions).
IndexOutOfBoundsException
errors around procedural types declared withvarargs
inVariableInitialization
.