TICS Analyzer - The TIOBE Coding Standard Checker - User Guide

The TIOBE Coding Standard (TICS) analyzer is capable of checking source code to inspect whether it adheres to the coding standards. Currently, TICS checks C, C++, C#, and Java code.

Table of Contents

Command Line Interface
Violation Suppression
Visual Studio Add-in
Visual Studio 6 Add-in
Tasking EDE Integration
Questions and Suggestions

Command Line Interface

TICS can be called from within a command shell by means of TICS [ @ ] { input } ... [ -- { compiler options } ]. Examples of TICS calls are TICS xyz.cpp abc.c and TICS @xyz.vcproj. The TICS executable accepts multiple files as arguments (including wildcards in directory and file names). It can also process a list of input files from a file list. This is achieved by prefixing the file list with an "at" symbol '@', e.g., TICS @Address.lst. It is not allowed to nest file lists. When the -- option is used, all following options will be passed to the compiler. The -- option helps to use TICS as a compiler replacement in makefiles.

The following TICS options are allowed.

-buildrelationsearchdepth int
maximum depth to search for makefiles (relative to the source file)
-calc ALL|AVGCYCLOMATICCOMPLEXITY|CODINGSTANDARD|COMPILERWARNING|FANOUT
calculate the specified (comma separated) metric type(s)
-changed
only check files that have changed with respect to the database
-checkedoutonly
only check files that are checked out
-compiler CodeComposer|Csc|DDK|Gcc|GANT|Keil|MULTI|None|Qac|Tasking|VC|<string>
use the specified compiler
-compileroptions string
pass the specified (comma separated) options to the compiler
-config string
use the given compiler configuration
-delta string
show new violations relative to a given SCM tag in the database
-deltaonly
show only new violations relative to the database
-dumpmoddeps
dump the internal module dependencies (internal use only)
-exitsqa
use the QA acceptation (yes/no) as exit code
-exitviolations
use the number of violations as exit code
-getrules
generate rule configuration for TicsConfig
-groupfile file
use the given group file
-help
show this help info
-hlpcfg
generate help output for TicsConfig
-ide eclipse|netbeans|rrt|slickedit|tasking|tornado|vs6|vs7|vs8|vs9|vs10|vs11|vs12
format output for the specified ide
-level int
show violations upto the specified level
-log int
show diagnostic messages upto the specified log level
-lowpriority
run the TICS client with low priority
-maxresults int
show maximally the specified number of violations
-nocalc ALL|AVGCYCLOMATICCOMPLEXITY|CODINGSTANDARD|COMPILERWARNING|FANOUT
do not calculate the specified (comma separated) metric type(s)
-noconfig
do not use TICSConfig settings
-nodelta
do not show deltas
-nologo
suppress TICS logo output
-noproject
do not use the TICSPROJECT environment variable
-norecalc ALL|AVGCYCLOMATICCOMPLEXITY|CODINGSTANDARD|COMPILERWARNING|FANOUT
do not recalculate the specified (comma separated) metric type(s) for unchanged files
-nowarn
suppress all warnings
-out file
output the analysis results to file in plain text format
-overviews
show violation overview tables [default: on]
-parallel
indicate that the client is running concurrently with other instances
-project string
quality database that is used to compare results
-projfile file
use the given project file
-recalc ALL|AVGCYCLOMATICCOMPLEXITY|CODINGSTANDARD|COMPILERWARNING|FANOUT
recalculate the specified (comma separated) metric type(s) for unchanged files
-results
show violation messages [default: on]
-rules
generate rule files for the TICS add-in
-showsuppressions
show suppressed violations in violation overview
-showsynopsis
show rule synopsis in violation overview [default: on]
-sort level|linenr|new
sort the violations according to the specified criterion (default 'linenr')
-srcfile file
source file that is used to check header file
-st
dump stack trace in case of errors
-synchronize
synchronize the file server files with the client
-timeinfo
show timing information on individual process stages [default: on]
-tmpdir dir
use the specified directory for intermediate files
-totaloverviews
show cumulative violation overview tables [default: on]
-version
show version info and exit
-xml file
output the analysis results to file in XML format

Violation Suppression

It is possible to suppress individual violations. Suppressing a violation can be done by using special comments in the code. These special comments starts with "//TICS" or "/*TICS". After the preceding "//TICS" or "/*TICS" one can specify what rules are suppressed by means of a sequence of "-ruleid" statements. E.g.

//TICS -OBJ_16 -DCL_12

The rules specified in the TICS violation suppression comment are suppressed for the remainder of the file, starting at the line that contains the comment. The comment has file scope, i.e., it will not apply to included files or enclosing files. It is allowed to use wildcards to specify rules. To switch on a rule again, one can use "+ruleid" statements. It is also possible to suppress a rule of only one specific source line. This is possible with the option "!ruleid".

The following example shows how this facility can be used in practice.

//TICS -OBJ_?: TODO still need to be fixed after discussion
// MainFrm.cpp : implementation of the CMainFrame class
//

#include "stdafx.h"
#include "test.h"

#include "MainFrm.h"

#ifdef _DEBUG
#define new DEBUG_NEW      //TICS !OSD_3:  AppWizard generated code
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMainFrame

IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)

//TICS -*: AppWizard and ClassWizard generated code
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
      //{{AFX_MSG_MAP(CMainFrame)
        // NOTE - the ClassWizard will add and remove mapping macros here.
        // DO NOT EDIT what you see in these blocks of generated code !
      ON_WM_CREATE()
      //}}AFX_MSG_MAP
END_MESSAGE_MAP()
//TICS +*

IMPORTANT NOTES


Visual Studio Add-in

This section describes the TICS Visual Studio Add-in for the following versions:

Visual Studio 2015
Visual Studio 2013
Visual Studio 2012
Visual Studio 2010
Visual Studio 2008
Visual Studio 2005
Visual Studio.NET 2003

The TICS add-in for Visual Studio consists of a toolbar with four buttons (see the picture below).

image
The TICS buttons have the following meaning.

Visual Studio 6 Add-in

The TICS add-in for Visual Studio 6 consists of a toolbar with six buttons (see the picture below).
image
The TICS buttons have the following meaning.

Tasking EDE Integration

It is possible to run TICS from within the Tasking IDE called EDE. To this end you have to perform the following steps. The Project Properties dialog should now look as follows.
image
Now the Custom Error Parser dialog will look as follows.
image
In order to use TICS support for Tasking one should make sure that the input file is part of a Tasking project file (extension .prj) and that the corresponding Tasking make file (extension .mak) is available.

Questions and Suggestions

The major goal of TICS is to improve the quality of the code archive by checking adherence to the coding standards. The TICS team welcomes any ideas or suggestions to achieve this goal faster and/or better. In case of questions or suggestion please e-mail to tics@tiobe.com or contact your local QA manager.