Skip to content

Releases: integrated-application-development/sonar-delphi

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.

1.10.0

01 Oct 02:22
Compare
Choose a tag to compare

Added

  • FullyQualifiedImport analysis rule, which flags non-fully qualified imports.
  • API: UnitImportNameDeclaration::isAlias method.

Changed

  • Non-trivial inherited expressions are excluded in RedundantParentheses.

Fixed

  • False positives around const array literals in RedundantParentheses.

1.9.0

03 Sep 06:19
Compare
Choose a tag to compare

Added

  • API: CaseItemStatementNode::getExpressions method.

Changed

  • Improve type inference around unsigned integer literals.
  • Improve type inference around array constructors containing integer literals.
  • Improve type inference around real expressions.
  • Parentheses enclosing a primary expression are considered redundant in RedundantParentheses.
  • out parameters are treated as uninitialized at the start of a routine in VariableInitialization.

Fixed

  • Name resolution errors around alias ancestor types.
  • Parsing errors around partial asm blocks blocks in conditional branches.
  • False positives around case items with multiple values in CaseStatementSize.

1.8.0

02 Aug 02:39
Compare
Choose a tag to compare

Added

  • "Correct to (correct case)" quick fix for LowercaseKeyword.
  • API: PropertyNameDeclaration::getImplementedTypes method.
  • API: PropertyNode::getDefaultSpecifier method.
  • API: PropertyNode::getImplementsSpecifier method.
  • API: PropertyNode::getIndexSpecifier method.
  • API: PropertyNode::getStoredSpecifier method.
  • API: PropertyDefaultSpecifierNode node type.
  • API: PropertyImplementsSpecifierNode node type.
  • API: PropertyIndexSpecifierNode node type.
  • API: PropertyStoredSpecifierNode node type.

Changed

  • Include the global library path in unit import resolution.
  • Improve AST modeling around property specifiers.
  • Improve semantic analysis around property specifiers.
  • Exclude properties with implements specifiers in UnusedProperty.

Fixed

  • Overly permissive parsing rules around string and file types.
  • Quick fixes removing comments and compiler directives in RedundantInherited.
  • False positives around message handler methods in RedundantInherited.
  • False positives when parameter names were mismatched to the inherited method in RedundantInherited and InheritedMethodWithNoCode.
  • API: ArrayConstructorNode::getImage returned an incorrect image containing [ as an element.

1.7.0

02 Jul 00:36
Compare
Choose a tag to compare

Added

  • RedundantInherited analysis rule, which flags redundant inherited statements that can be safely removed.

Changed

  • Include "found" and "expected" values for issue messages in LowercaseKeyword.
  • Exclude J and K by default in ShortIdentifier.
  • Improve compiler directive parsing in cases where the directive name is not followed by whitespace.

Fixed

  • The result attribute in NUnit test reports was not being treated as case-insensitive.
  • Scan failures on nested compiler directives.

1.6.0

31 May 04:10
Compare
Choose a tag to compare

Added

  • "Move to implementation section" quick fix for ImportSpecificity.
  • "Remove unused import" quick fix for UnusedImport.
  • API: UsesClauseNode::getImports method.
  • API: InterfaceSectionNode::getUsesClause method.
  • API: ImplementationSectionNode::getUsesClause method.
  • API: LabelNameDeclaration symbol declaration type.
  • API: DelphiScope::getLabelDeclarations method.
  • API: LabelDeclarationNode node type.
  • API: LabelStatementNode::getNameReference method.
  • API: LabelStatementNode::getStatement method.
  • API: GotoStatementNode::getNameReference method.

Changed

  • Improve semantic analysis around label and goto statements.
  • Improve handling for dereferenced types starting with E and I in PointerName.
  • Improve handling for dereferenced types that don't comply with naming conventions in PointerName.

Fixed

  • File pointer errors when an issue is raised on the first line of a file with a byte order mark.
  • Symbol table construction errors for program files omitting the program header.
  • Parsing errors on parenthesised anonymous methods.
  • Parsing errors on identifiers named Label, which was allowed in Delphi.NET.
  • Scan failures on invalid paths in dproj files.
  • Incorrect ordering of edits in the "Separate grouped parameters" quick fix for GroupedParameterDeclaration.
  • SonarLint registration of rules that don't support execution in a SonarLint context.

1.5.0

02 May 03:44
Compare
Choose a tag to compare

Added

  • Support for the winapi calling convention.
  • Support for quick fixes.
  • "Remove the superflous semicolon" quick fix for SuperfluousSemicolon.
  • "Correct to (correct case)" quick fix for MixedNames.
  • "Remove redundant parentheses" quick fix for RedundantParentheses.
  • "Convert to initialization section" quick fix for LegacyInitializationSection.
  • "Replace Pascal-style result with Result" quick fix for PascalStyleResult.
  • "Replace with TList.Last" quick fix for IndexLastListElement.
  • "Remove empty argument list" quick fix for EmptyArgumentList.
  • "Remove redundant assignment check" quick fix for AssignedAndFree.
  • "Separate grouped parameters" quick fix for GroupedParameterDeclaration.
  • "Remove (n) unused formatting arguments" quick fix for FormatArgumentCount.
  • "Use string value directly" quick fix for FormatArgumentCount.
  • API: TryStatementNode::getExceptBlock method.
  • API: WhileStatementNode::getGuardExpression method.
  • API: WhileStatementNode::getStatement method.
  • API: DelphiTokenType.WINAPI token type.
  • API: DelphiIssueBuilder type, which is returned by DelphiCheckContext::newIssue.
  • API: QuickFix type, which is accepted by DelphiIssueBuilder::withQuickFixes.
  • API: QuickFixEdit type, which is accepted by QuickFix::addEdits.

Deprecated

  • API: TryStatementNode::getExpectBlock method, use getExceptBlock instead.

Fixed

  • False positive FormatStringValid issues on strings containing uppercase format specifiers.
  • Exception when parsing fully qualified attribute references.
  • DuplicatedDeclarationException errors caused by some local scopes being modeled incorrectly.
  • Name resolution issues around if, else, for, and with constructs when the body contains a single statement.

1.4.0

02 Apr 02:32
Compare
Choose a tag to compare

Added

  • Support for multiline string literals within compiler directives.
  • Support for the TEXTBLOCK directive.
  • Support for named arguments.
  • Support for assembly attributes.
  • API: CompilerDirectiveParser can now return a new TextBlockDirective type.
  • API: CheckVerifier::withCompilerVersion method.
  • API: CheckVerifier::withToolchain method.
  • API: DelphiTokenType.ARGUMENT token type.
  • API: DelphiTokenType.ASSEMBLY token type.
  • API: ArgumentNode node type.
  • API: ArgumentListNode::getArgumentNodes method.
  • API: AttributeNode::isAssembly method.

Changed

  • NativeInt and NativeUInt are now treated as weak aliases in Delphi 12+.
  • The length of open arrays is now modeled as NativeInt in Delphi 12+.
  • Performance improvements.

Deprecated

  • API: ArgumentListNode::getArguments method, use getArgumentNodes instead.

Fixed

  • Type resolution inaccuracies around subtract expressions.
  • Name resolution did not occur for the magic Width and Decimals arguments. (See: System.Write)
  • The wrong inherited method could be found in InheritedMethodWithNoCode, causing false negatives.
  • Exception when scanning UNC paths.

1.3.0

01 Mar 04:55
Compare
Choose a tag to compare

Added

  • Support for multiline string literals.
  • Support for numeric literals prefixed by ampersands.
  • Support for identifiers prefixed by more than 2 ampersands.
  • API: TextLiteralNode::isMultiline method.
  • API: TextLiteralNode::getValue method, which returns the effective contents of a text literal.

Changed

  • TextLiteralNode::getImage now returns the text literal exactly as it appears in source code.
  • TextLiteralNode::getImageWithoutQuotes now simply calls the new getValue method.

Deprecated

  • TextLiteralNode::getImageWithoutQuotes, use getValue instead.
  • DelphiTokenType.AMPERSAND, as & is now lexed directly into numeric literals and identifiers.

Fixed

  • Static char arrays weren't accepted for '%s' in FormatArgumentType.
  • Imaginary tokens could be erroneously matched by the lexer in valid source code.