Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
{iframe:src=http://update.sonarsource.org/plugins/delphi.html|width=700|height=250|frameborder=0} Your browser does not support iframes. {iframe}
Wiki Markup
Warning
titleDeprecated

This plugins is deprecated because it is no longer maintained by its contributors.

Description / Features

This plugin is donation of Sabre Airline Solutions

It enables analysis of projects written using Delphi or Pascal. It was tested with projects written in Delphi 6, 7, 2006 and XE.

It is using grammar in ANTLR v3 format. It is extended on grammar found at http://www.dragonkiller.nl/Delphi/delphi2009.txt

It is compatible with the Issues Report plugin to run pre-commit local analysis.

Installation

  1. Install the plugin through the Update Center or download it into the SONARQUBE_HOME/extensions/plugins directory
  2. Restart the SonarQubeTM server

Include Page
Include - Plugin Installation
Include - Plugin Installation

Usage

Run an Analysis with the SonarQube

TM

Runner (Recommended

Way

method)

To launch an analysis of your Delphi project, use the SonarQube TM Runner.

A sample project is available on github that can be browsed or downloaded/projects/languages/delphi/delphi-sonar-runner.

Run a

SonarQubeTM Analysis

SonarQube Analysis with other Analyzers

Maven and Ant can also be used to launch analysis on Delphi projects.

...

  1. Grammar has problems with recognizing certain identifiers. When we add whitespace (“ “) at several places, everything works fine. It was difficult to solve this problem from the grammar level, so it is solved in DelphiSourceSanitizer class. It adds whitespaces where there are needed in parsed file, and grammar works fine. It is used for:
    1. Colon, “:” -> “ :”
    2. Array range, “x..y” -> “x .. y”
  2. Grammar is NOT case insensitive, but Delphi code is. Plugin deals with it by DelphiSourceSanitizer class, which feeds ANTLR parser lowercase characters (the “LA” method)
  3. Number of classes includes: classes, records
  4. Directory is count as a package. Number of packages equals number of directories.
  5. Preprocessor definitions between {$if xxx} and {$ifend} are removed (DefineResolver class).
  6. Sources imported to SonarQubeTM are SonarQube are parsed through IncludeResolver class. It means, that the source will be lowercased and unknown preprocessor definitions will be cut out.

...