Skip to content

Releases: integrated-application-development/sonar-delphi

1.17.0

15 May 06:27
Compare
Choose a tag to compare

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, use getGuidExpression instead.
  • API: DelphiTokenType.GUID, as the associated InterfaceGuidNode 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

08 May 23:56
Compare
Choose a tag to compare

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 flags case statements that do not handle all values in an enumeration.
  • IterationPastHighBound analysis rule, which flags for loops that iterate past the end of the collection.
  • ExplicitBitwiseNot analysis rule, which flags potentially incorrect bitwise not 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 through getEnumeratorOccurrence instead.
  • API: ForInStatementNode::getMoveNextDeclaration method, get the declaration through getEnumeratorOccurrence instead.
  • API: ForInStatementNode::getCurrentDeclaration method, get the declaration through getEnumeratorOccurrence instead.
  • API: TypeParameterNode::getTypeConstraintNodes method, use getConstraintNodes instead.
  • API: TypeParameterType::constraints method, use constraintItems instead.

Fixed

  • False positives on enumerable method GetEnumerator in UnusedRoutine.
  • False positives on enumerator method MoveNext in UnusedRoutine.
  • False positives on enumerator property Current in UnusedProperty.
  • 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 with constructor constraints.
  • Name resolution failures on read, write, and stored 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

03 Apr 03:00
Compare
Choose a tag to compare

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, use TYPEDADDRESS instead.

Fixed

  • Exceptions from empty structures (e.g., if) in LoopExecutingAtMostOnce and RedundantJump.
  • 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 and const in PlatformDependentTruncation.
  • 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

05 Mar 03:49
Compare
Choose a tag to compare

Fixed

  • File pointer errors around >= and <= tokens.

1.14.0

03 Mar 03:52
Compare
Choose a tag to compare

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 the MixedNames 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

05 Feb 00:54
Compare
Choose a tag to compare

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)
  • Empty anonymous methods are now ignored in EmptyBlock.
  • Empty anonymous methods are now flagged in EmptyRoutine.

1.12.2

05 Jan 23:50
Compare
Choose a tag to compare

Fixed

  • Incorrect case-sensitive treatment of file names in coverage reports.

1.12.1

06 Dec 07:29
Compare
Choose a tag to compare

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

02 Dec 02:55
Compare
Choose a tag to compare

Added

  • API: DelphiCheckContext::getUri method.

Fixed

  • Parsing errors on semicolon-delimited generic type parameters in routine implementation headers.
  • Incorrect return types for Length, High, and Low 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

04 Nov 02:39
Compare
Choose a tag to compare

Added

  • MissingRaise analysis rule, which flags exception constructions for which raise 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 with varargs in VariableInitialization.