Skip to content

Releases: integrated-application-development/sonar-delphi

1.19.0

Choose a tag to compare

@github-actions github-actions released this 09 Jun 04:21

Added

  • Support for noreturn routines, introduced in Delphi 13.
  • Support for unmanaged generic constraint, introduced in Delphi 13.
  • Support for interface generic constraint, introduced in Delphi 13.
  • Support for NameOf intrinsic, introduced in Delphi 13.
  • Support for implicit Self in Initialize and Finalize operators, introduced in Delphi 13.
  • Support for DCCARM64EC toolchain, introduced in Delphi 13.1.
  • NoreturnContract analysis rule, which flags noreturn routines that return normally.
  • Full support for the HIGHCHARUNICODE compiler directive.
  • Support for the DCC_CodePage property in dproj files.
  • sonar.delphi.codePage property to specify the code page that will be used to interpret ANSI data.

Changed

  • The ANSI encoding configured by sonar.delphi.codePage or inferred from DCC_CodePage is now preferred over the system encoding when parsing source files.
  • Metrics are no longer reported on test sources.
  • Duplications are no longer reported on test sources.
  • Coverage data is no longer reported on test sources.

Fixed

  • The configured sonar.sourceEncoding was never used for search path units.
  • Quick fixes removing too much surrounding code in RedundantInherited.

1.18.3

Choose a tag to compare

@github-actions github-actions released this 11 Nov 04:39

Fixed

  • Stack overflow on alias types that reference their containing type.

1.18.2

Choose a tag to compare

@cirras cirras released this 01 Oct 00:30

Fixed

  • Parsing errors on qualified name references within exports sections.

1.18.1

Choose a tag to compare

@github-actions github-actions released this 07 Aug 03:41

Added

  • excludedTypes rule property to the ObjectPassedAsInterface rule.

Changed

  • Exclude common non-ref-counted interface implementations by default in ObjectPassedAsInterface.
  • Handle property references in ObjectPassedAsInterface (in addition to variables/fields).

Fixed

  • Inaccurate type comparisons between class and interface types, where class-to-class upcasts were not always preferred over class-to-interface upcasts.
  • False-positives around qualified name references in ObjectPassedAsInterface.

1.18.0

Choose a tag to compare

@github-actions github-actions released this 05 Aug 00:15

Added

  • ObjectPassedAsInterface analysis rule, which detects object references that are passed directly as an interface to a routine.
  • TooManyDefaultParameters analysis rule, which flags routines with an excessive number of default parameters.

Changed

  • EmptyBlock now ignores all empty blocks containing an explanatory comment.
  • TooManyParameters now flags routine declarations instead of implementations, improving support for methods that are virtual, abstract, or on an interface.

1.17.2

Choose a tag to compare

@github-actions github-actions released this 02 Jul 23:08

Fixed

  • Ambiguous type comparisons from variants to real types.

1.17.1

Choose a tag to compare

@github-actions github-actions released this 10 Jun 03:53

Fixed

  • Inaccurate handling of variant conversions, which resulted in overload resolution failures.

1.17.0

Choose a tag to compare

@github-actions github-actions released this 15 May 06:27

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.
  • API: IntrinsicType.OPENSTRING enum value.

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

Choose a tag to compare

@github-actions github-actions released this 08 May 23:56

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

Choose a tag to compare

@github-actions github-actions released this 03 Apr 03:00

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