| Overview | Download & Installation | License | Documentation | Get support | For developers

### Overview

Software Index measures, reports and validates software statistic, searches for duplications, scans for errors, 'coding style' violations and occasions of broken design patterns which are defined by your design team.

#### The list of collected statistics:

- Number of executable symbols and lines
- Number of symbols and lines in comments
- Number of symbols and lines in initial source file
- Number of lines in specific comments
  (header descriptions before functions)
- Number of symbols in name of a function
- Number of blocks
- Maximum indent level (depth level)
- Cyclomatic complexity (McCabe's / Myer's) index
- Number of functions, files, modules
- Number of symbols in duplicated fragments
- Code coverage indexes
  (line coverage, branch coverage and entry/exit coverage data from external gcov tool)

#### Parsing, scaning and searching can be performed for the different content:

- initial - the initial source content
- code - the initial code (without comments)
- comments - comments only (no code)
- no preprocessor - preprocessor strings excluded (without comments and preprocessor)
- no strings - strings excluded (without comments and strings)
- purified - strings and preprocessor excluded (without comments, strings and preprocessor)
- comment header - comments before function's header
- function's name - name of a function
- function's head - purified function's header, no body
- function's body - purified function's body, no header

#### Every counter is collected per:

- function
- file
- module
- project

#### Single indexes and indexes for distributions are collected:

- exact value
- average value within a distribution
- minimum value within a distribution
- maximum value within a distribution
- sum of values within a distribution

#### Validation rules can be applied to the different content:

- added functions (objects)
- removed functions (objects)
- modified functions (objects)
- cloned functions (objects)
- unmodified functions (objects)

#### Internal tools helps to adapt Software Index for your specific needs:

- code preprocessor: simplifies the code parsing and scaning with preprocessor definitions
- code scanner: similar 'grep' tool, helps to find occasion of 'bad' coding style/formating and detect broken rules which defined by your design team, has flexible suppress methods
- code indexer: collect the statistics, there 3 levels of severity (info, notice, warning) for limits which are easily configurable, has flexible suppress methods
- searcher of duplicated fragments: helps to find and reduce duplication in your source code
- report converter: processes the final report in XML format, filters the information according configuration and dumps the info messages, notices, warnings and erros to file and stderr stream

#### Supported languages:

- C (stable version)
- C++ (beta version)

#### Limitations:

- Parser does not detect functions (C language) with declarations of local variables outside of function's body. However, it is not a problem for a major part of software products. The example below demostrates problematic formatting/style:

This function is not detectable by Software Index. | This function is parsable.

    int getMax(int* array, int length)
        int i = 0;
        int curMax;
    {
        /* ... */
    }

    int getMax(int* array, int length)
    {
        int i = 0;
        int curMax;
        /* ... */
    }

- Comments inside preprocessor strings are not acceptable (C/C++ languages). Otherwise, some code can be unrecognizable by Software Index.

This code is not recognizable by Software Index. | This code is parsable.

    #define GET_MAX(a, b)       \
        /*                      \
         * This macros returns  \
         * maximum from a and b \
         */                     \
        ((a > b) ? a : b)

    /*
     * This macros returns
     * maximum from a and b
     */
    #define GET_MAX(a, b) \
        ((a > b) ? a : b)

- Interface with gcov tool is not tested for C++ language.

### Download & Installation

For the installation of the Software Index download the archive with all required modules and unpack it to some folder. Also, you have got an option to get the source code from the version conrol sytem.

Warning: Software Index has an internal tool (dupindex) which should be compiled for the target platform. By default, the distributable archive includes the compiled binary for PC Windows (x86) platform. Recompile it if you need (only one file: dupindex.cpp), using g++ or some other C++ compiler for your specific platform. There is a project configuration file for users of Microsoft Visual Studio 2008. There is Makefile for users of gmake and g++ tools.

#### Prerequisites:

- Perl Runtime Environment (version 5.6.x or later)
- Perl modules (usualy, they are all included to the standard installation package of Perl engine):
  - Cwd
  - Pod::Usage
  - Data::Dumper
  - FileHandle
  - IPC::Open3
  - XML::Simple (included to the distributable archive with Software Index)
  - String::CRC::Cksum (included to the distributable archive with Software Index)
- gcov (optional, it is needed if you like to collect coverage statistic)

### License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 3 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with the Software Index; if not, contact Project Administrator and write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

### Documentation

The context help is available by:

    > perl swi_main.pl --help

The sample/description of the configuration file is available by link:

    http://swi.svn.sourceforge.net/viewvc/swi/swi_config_sample.xml?view=markup

In the command line context, it is accessable by:

    > perl swi_main.pl --sample

### Get support

The best way to get help is by creating a new item in the 'Request Tracker'.

#### Alternatives

If you believe the project may have a different support resource that would be better for submitting the particular issue, please consider the following alternatives:

- Mail to the Administrator
- Mail to the Administrator using WEB form
- Create new bug report
- Create new feature request

#### Our time response

Software Index is used in real, time critical software development projects. It profiles software products which should work stably 24 hours a day, 7 days a week. As a result, we catch major portion of bugs ourself before the official release of new version of the Software Index.

In addition to this, please, notice that it is developed by enthusiasts in their free time. Thus, we can not guarantee the immediate response. However, we always try to process bug reports and support requests as soon as possible, prioritizing the support activities.

### For developers

If you have troubleshooted the problem, prepared the correction and believe that it should be included to the official distributive, please create new patch review request and attach the Patch to the tracker.

Note: Patch files are simply Unified-Diff files showing the differences between your working copy and the base revision.

#### Join this project:

In order to participate in development activities, join this project:
please, contact the project administrators of this project, as shown on the project summary page.

#### Get the source code:

Source code for this project may be available as downloads or through the Subversion SCM repository used by the project.

#### Beta testing:

You are very welcome to download beta versions and provide your feedback, reporting proposals and new issues in bug tracker system used by the project.

If you requested a feature, we are happy to deliver it to you firstly for beta testing before including to the final release version.

#### Update project web pages:

If you are a web page developer interested in this project, please consider reaching out to the project Administrator (per the "Join this project" section, above) to offer your assistance.

Copyright © 2009 - 2010
Software Index Project

License: GPL

###