Bläddra i källkod

Help, project page ready.

avkonst 15 år sedan
förälder
incheckning
1f888c9eda
4 ändrade filer med 283 tillägg och 177 borttagningar
  1. 5 0
      lib/SWI/Processor.pm
  2. 135 61
      project.html
  3. 14 11
      style.css
  4. 129 105
      swi_main.pl

+ 5 - 0
lib/SWI/Processor.pm

@@ -466,6 +466,11 @@ sub swiParse
         $globalBlock_Purified
     );
 
+    # Add coverage statistic
+    my $fh = new FileHandle( $location . "/" . $file, "r" )
+      or die("Can not open input file '$location/$file'!");
+
+
     return $functionsData;
 }
 

+ 135 - 61
project.html

@@ -3,26 +3,26 @@
 <head>
 <!--
 
-    ExecKit, Copyright 2009, ExecKit Project Team
-    Link: http://execkit.sourceforge.net
-
-    This file is part of ExecKit.
-
-    ExecKit is free software: you can redistribute it and/or modify
+    Software Index, Copyright 2010, Software Index Project Team
+    Link: http://swi.sourceforge.net
+    
+    This file is part of Software Index Tool.
+    
+    Software Index 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.
-
-    ExecKit is distributed in the hope that it will be useful,
+    
+    Software Index 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 ExecKit.  If not, see <http://www.gnu.org/licenses/>.
+    along with Software Index.  If not, see <http://www.gnu.org/licenses/>.
 
 -->
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-5" />
-<title>ExecKit Project</title>
+<title>Software Index Project</title>
 <link href="style.css" rel="stylesheet" type="text/css" />
 </head>
 
@@ -33,84 +33,158 @@
     <td valign="middle">&nbsp;</td>
   </tr>
   <tr>
-    <td width="350"><img src="images/logo_project.jpg" alt="ExecKit Project Page" width="350" height="128" /></td>
-    <td valign="bottom">      <div align="right"><a href="#Description">Description</a> | <a href="#Download">Download</a> | <a href="#License">License</a> | <a href="#Documentation">Documentation</a> | <a href="#Getsupport">Get support </a>| <a href="#Fordevelopers">For developers</a></div></td>
+    <td width="350"><img src="images/logo_project.jpg" alt="Software Index Project Page" width="350" height="128" /></td>
+    <td valign="bottom">      <div align="right">
+      <p><a href="http://sourceforge.net/projects/swi"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=275098&amp;type=10" alt="Get Software Index at SourceForge.net. Fast, secure and Free Open Source software downloads" width="80" height="15" border="0" /></a></p>
+      <p>&nbsp;</p>
+      <p><a href="#Description">Description</a> | <a href="#Download">Download &amp; Installation </a> | <a href="#License">License</a> | <a href="#Documentation">Documentation</a> | <a href="#Getsupport">Get support </a>| <a href="#Fordevelopers">For developers</a></p>
+    </div></td>
   </tr>
   <tr>
+    <td colspan="2"><hr></td>
+  </tr>  <tr>
     <td colspan="2" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="10">
+      
       <tr>
-        <td valign="top"><hr>
-          <h3><a id="Description"></a>Description</h3>
-          <p><strong>ExecKit</strong> is a set of software units which are assigned to simplify, automate
-                the execution and its analysis of different kinds of tasks and commands.
-                Especially, you may use it for:</p>
+        <td valign="top"><h3><a id="Description"></a>Description</h3>
+          <p><span class="normalImportance">Software Index </span>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.</p>
+          <h4>The list of collected statistics:</h4>
+          <ul>
+                <li>Number of <span class="normalImportance">executable symbols</span> and <span class="normalImportance">lines</span> </li>
+                <li>Number of <span class="normalImportance">symbols</span> and <span class="normalImportance">lines in comments</span></li>
+                <li>Number of <span class="normalImportance">symbols</span> and<span class="normalImportance"> lines in initial source file</span></li>
+                <li>Number of <span class="normalImportance">lines in specific comments</span> (header descriptions before functions)  </li>
+                <li>Number of <span class="normalImportance">symbols in name</span> of a function </li>
+                <li>Number of <span class="normalImportance">blocks</span></li>
+                <li>Maximum <span class="normalImportance">indent level</span> (depth level) </li>
+                <li><span class="normalImportance">Cyclomatic complexity</span> (McCabe's / Mayer's) index </li>
+                <li>Number of <span class="normalImportance">functions, files, modules</span></li>
+                <li>Number of symbols in <span class="normalImportance">duplicated fragments</span></li>
+            </ul>
+          <h4>Parsing, scaning and searching can be performed for the different content:</h4>
+          <ul>
+            <li><span class="normalImportance">initial</span>         - the initial source content</li>
+            <li> <span class="normalImportance">code</span>            - the initial code (without comments)</li>
+            <li> <span class="normalImportance">comments</span>        - comments only (no code)</li>
+            <li> <span class="normalImportance">no preprocessor</span>  - preprocessor strings excluded (without comments and preprocessor)</li>
+            <li> <span class="normalImportance">no strings</span>       - strings excluded (without comments and strings)</li>
+            <li> <span class="normalImportance">purified</span>        - strings and preprocessor excluded (without comments, strings and preprocessor)</li>
+            <li> <span class="normalImportance">comment header</span>   - comments before function's header</li>
+            <li> <span class="normalImportance">function's name</span>    - name of a function</li>
+            <li> <span class="normalImportance">function's head</span>    - purified function's header, no body</li>
+            <li> <span class="normalImportance">function's body</span>    - purified function's body, no header</li>
+            </ul>
+          <h4>Every counter is collected per:</h4>
+          <ul>
+            <li>function</li>
+            <li> file</li>
+            <li>module</li>
+            <li>project</li>
+            </ul>
+          <h4>Single indexes and indexes for distributions are collected:</h4>
+          <ul>
+            <li><span class="normalImportance">exact</span> value</li>
+            <li> <span class="normalImportance">average</span> value within a distribution</li>
+            <li> <span class="normalImportance">minimum</span> value within a distribution</li>
+            <li> <span class="normalImportance">maximum</span> value within a distribution</li>
+            <li><span class="normalImportance">sum</span> of values within a distribution</li>
+            </ul>
+          <h4>Validation rules can be applied to the different content:</h4>
           <ul>
-                <li>daily/nightly builds and tests of software products</li>
-            <li>checking the serviceability of your services</li>
-            <li>preparation of test reports</li>
-            <li>tracking status of a product</li>
-            <li>increasing visibility of a software project</li>
-            <li>automation of many other routine tasks which you perform from time to time</li>
-            <li> ...</li>
+            <li><span class="normalImportance">added</span> functions (objects)</li>
+            <li> <span class="normalImportance">removed</span> functions (objects)</li>
+            <li> <span class="normalImportance">modified</span> functions (objects)</li>
+            <li><span class="normalImportance">cloned</span> functions (objects)</li>
+            <li><span class="normalImportance">unmodified</span> functions (objects)</li>
           </ul>
-          <h3><a id="Download"></a>Download </h3>
-          <p>For the installation of the ExecKit <a href="http://sourceforge.net/projects/execkit/files/">download</a> the archive with all ExecKit's modules.<br />
-                  <em>Note:</em> read the documentation to check the prerequisites for the ExecKit and to get installation instructions. </p>
-          <p>Also, you have an option to get the <a href="http://execkit.svn.sourceforge.net/viewvc/execkit/">source code</a> from the version conrol sytem.</p>
-          <h3><a name="License" id="Download"></a>License </h3>
+          <h4>Internal tools helps to adapt the tool for your specific needs:</h4>
+          <ul>
+            <li><span class="normalImportance">code preprocessor</span>: simplifies the code parsing and scaning with preprocessor definitions</li>
+            <li> <span class="normalImportance">code scanner</span>: 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 </li>
+            <li><span class="normalImportance">code indexer</span>: collect the statistics, there 3 levels of severity (info, notice, warning) for limits which are easily configurable, has flexible suppress methods</li>
+            <li><span class="normalImportance">searcher of duplicated fragments</span>: helps to find and reduce duplication in your source code</li>
+            <li><span class="normalImportance">report converter</span>: 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</li>
+            </ul>
+          <h4>Supported languages:</h4>
+          <ul>
+            <li>C (stable version) </li>
+            <li>C++ (beta version) </li>
+          </ul>
+          <h3><a id="Download"></a>Download &amp; Installation</h3>
+          <p>For the installation of the <span class="normalImportance">Software Index</span> <a href="http://sourceforge.net/projects/swi/files/">download</a> the archive with all required modules and unpack it to some folder.</p>
+          <p><em class="highImportance">Warning:</em> <span class="normalImportance">Software Index</span> 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. </p>
+          <h4>Prerequisites:</h4>
+          <ul>
+            <li>Perl Runtime Environment (version 5.6.x or later)</li>
+            <li>Perl modules (usualy, they are all included to the standard installation package of Perl engine):
+              <ul>
+                <li>Cwd</li>
+                <li>Pod::Usage</li>
+                <li> Data::Dumper</li>
+                <li> FileHandle</li>
+                <li>IPC::Open3</li>
+                <li> XML::Simple (included to the distributable archive with <span class="normalImportance">Software Index</span>)</li>
+                <li> String::CRC::Cksum (included to the distributable archive with <span class="normalImportance">Software Index</span>)</li>
+              </ul>
+            </li>
+          </ul>
+          <p>Also, you have got an option to get the <a href="http://swi.svn.sourceforge.net/viewvc/swi/">source code</a> from the version conrol sytem.</p>
+          <h3><a name="License" id="Download"></a>License</h3>
           <p> 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.</p>
           <p> 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<br />
+            MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
             GNU General Public License for more details.</p>
           <p> You should have received a copy of the GNU General Public License along
-            with the modules of ExecKit; if not, contact <a href="mailto:avkonst@users.sourceforge.net">ExecKit Project Administrator</a> and write to the Free Software Foundation, Inc.,
+            with the <span class="normalImportance">Software Index</span>; if not, contact <a href="mailto:avkonst@users.sourceforge.net">Project Administrator</a> and write to the Free Software Foundation, Inc.,
             51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.</p>
-          <h3><a id="Documentation"></a>Documentation </h3>
-          <p>The documentation is available:</p>
-          <ul>
-                <li>in <a href="help.php">html</a> format (with cross-references) for the latest version of ExecKit.</li>
-            <li>in <a href="help-v0.4.0.pdf">pdf</a> format (printable format, without cross-references) for the version 0.4.0 </li>
-          </ul>
+          <h3><a id="Documentation"></a>Documentation</h3>
+          <p>The context help is available by:</p>
+          <pre>&gt; perl swi_main.pl --help</pre>
+          <p>The description of the configuration file is accessable by:</p>
+          <pre>&gt; perl swi_main.pl --sample</pre>
           <h3><a id="Getsupport"></a>Get support</h3>
-          <p></p>
-          <h4>Self-Help Resources for this project</h4>
-          <p>Before contacting the ExecKit project regarding a support issue, we encourage  you to try using any self-help materials that the ExecKit project provides, such  as <a href="#Documentation">documentation</a> and known <a href="https://sourceforge.net/tracker/?group_id=275098&amp;atid=1168846">bug lists</a> and <a href="https://sourceforge.net/tracker/?group_id=275098&amp;atid=1168847">support requests</a>. </p>
-          <h4>Bug tracker </h4>
-          <p>If the answer is not  found than the best way to get help is by <a href="https://sourceforge.net/tracker/?func=add&amp;group_id=275098&amp;atid=1168846">creating a new item</a> in the Bugs Tracker.</p>
-          <h4>Alternatives </h4>
+          <p>The best way to get help is by <a href="https://sourceforge.net/tracker/?func=add&amp;group_id=275605&amp;atid=1170878">creating a new item</a> in the 'Request Tracker'.</p>
+          <h4>Alternatives</h4>
           <p>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:</p>
           <ul>
                 <li><a href="mailto:avkonst@users.sourceforge.net">Mail to the Administrator</a> </li>
             <li><a href="https://sourceforge.net/sendmessage.php?touser=2608471">Mail to the Administrator using WEB form</a></li>
-            <li><a href="https://sourceforge.net/tracker/?func=add&amp;group_id=275098&amp;atid=1168847">Create new support request</a></li>
-            <li><a href="https://sourceforge.net/tracker/?func=add&amp;group_id=275098&amp;atid=1168849">Create new  feature request</a></li>
+            <li><a href="https://sourceforge.net/tracker/?func=add&amp;group_id=275605&amp;atid=1170877">Create new bug report </a></li>
+            <li><a href="https://sourceforge.net/tracker/?func=add&amp;group_id=275605&amp;atid=1170880">Create new  feature request</a></li>
           </ul>
           <h4>Our time response</h4>
-          <p>ExecKit is developed by enthusiasts in free time, so we can not guarantee the immediate response. However, we always try to consider bug reports and support requests as soon as possible prioritizing the support activities.</p>
+          <p><span class="normalImportance">Software Index</span> 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 <span class="normalImportance">Software Index</span>.</p>
+          <p>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.</p>
           <h3><a id="Fordevelopers"></a>For developers</h3>
-          <p></p>
-          <h4>Join this project:</h4>
-          <p>To join this project, please contact the project administrators of this project, as shown on the <a href="http://sourceforge.net/projects/execkit/"> project summary page</a>. </p>
-          <h4> Get the source code: </h4>
-          <p> Source code for this project may be available as <a href="http://sourceforge.net/project/platformdownload.php?group_id=275098"> downloads </a> or through the  Subversion SCM <a href="http://execkit.svn.sourceforge.net/viewvc/execkit/">repository</a> used by the project. </p>
-          <h4> Uploading patch: </h4>
-          <p>If you have troubleshooted the problem, prepared the correction and believe that it should be included to the official ExecKit distributive, please create <a href="https://sourceforge.net/tracker/?func=add&amp;group_id=275098&amp;atid=1168848">new patch review request</a> and attach the Patch to the tracker.</p>
+          <p>If you have troubleshooted the problem, prepared the correction and believe that it should be included to the official distributive, please create <a href="https://sourceforge.net/tracker/?func=add&amp;group_id=275605&amp;atid=1170879">new patch review request</a> and attach the Patch to the tracker.</p>
           <p><em>Note:</em> Patch files are  simply Unified-Diff files showing the differences between your working copy and  the base revision.</p>
-          <h4>Beta testing: </h4>
-          <p>You are very welcome to <a href="http://sourceforge.net/projects/execkit/files/">download</a> beta versions and provide your feedback, reporting proposals and new issues in <a href="https://sourceforge.net/tracker/?group_id=275098&amp;atid=1168846">bug tracker</a> system used by the ExecKit project.</p>
+          <h4>Join this project:</h4>
+          <p>In order to participate in development activities,  join this project:<br /> 
+            please, contact the project administrators of this project, as shown on the <a href="http://sourceforge.net/projects/swi/"> project summary page</a>. </p>
+          <h4> Get the source code:</h4>
+          <p> Source code for this project may be available as <a href="http://sourceforge.net/projects/swi/files/">downloads</a> or through the  Subversion SCM <a href="http://swi.svn.sourceforge.net/viewvc/swi/">repository</a> used by the project. </p>
+          <h4>Beta testing:</h4>
+          <p>You are very welcome to <a href="http://sourceforge.net/projects/swi/files/">download</a> beta versions and provide your feedback, reporting proposals and new issues in <a href="https://sourceforge.net/tracker/?group_id=275605&amp;atid=1170877">bug tracker</a> system used by the project.</p>
           <p>If you requested a feature, we are happy to deliver it to you firstly for beta testing before including to the  final release version. </p>
-          <h4>Update project web pages: </h4>
-          <p> If you are a web page developer interested in this project, please consider reaching out to the project <a href="https://sourceforge.net/sendmessage.php?touser=2608471">admin</a> (per the &quot;Join this project&quot; section, above) to offer your assistance.</p></td>
+          <h4>Update project web pages:</h4>
+          <p> If you are a web page developer interested in this project, please consider reaching out to the project <a href="https://sourceforge.net/sendmessage.php?touser=2608471">Administrator</a> (per the &quot;Join this project&quot; section, above) to offer your assistance.</p></td>
       </tr>
     </table>
-        <h3>&nbsp;</h3></td>
+        <hr></td>
   </tr>
   <tr>
-    <td colspan="2"><div align="center">
-      <h3>Copyright <strong>&copy; </strong>2008 - 2009 <a href="mailto:avkonst@users.sourceforge.net;kfedos@users.sourceforge.net">ExecKit Project Team</a> | License: <a href="http://www.gnu.org/licenses/gpl.txt">GPL</a> | <a href="http://sourceforge.net/projects/execkit"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=275098&amp;type=10" alt="Get ExecKit at SourceForge.net. Fast, secure and Free Open Source software downloads" width="80" height="15" border="0" /></a></h3>
+    <td colspan="2"><div align="center">      
+      <p align="right">Copyright <strong>&copy; </strong>2009 - 2010<br />  
+        <a href="mailto:avkonst@users.sourceforge.net"><span class="normalImportance">Software Index</span> Project</a></p>
+      <p align="right">License: <a href="http://www.gnu.org/licenses/gpl.txt">GPL</a></p>
+      <h3 align="right"></h3>
     </div></td>
   </tr>
 </table>

+ 14 - 11
style.css

@@ -28,39 +28,42 @@ body{
 	color: #333333;
 	line-height: 1.166;
 	margin: 0px;
-	padding: 0px;
+	padding: 10px;
 	font-size: 14px;
 }
 
+pre{
+    font-size: 100%;
+}
 td{
 	background-position: left;
 	background-repeat: no-repeat;
 }
 
 a{
-	color: #3399FF;
+	color: #AA0033;
 	text-decoration: none;
 }
 
 a:link{
-	color: #3399FF;
+	color: #AA0033;
 	text-decoration: none;
 }
 
 a:visited{
-	color: #3399FF;
+	color: #AA0033;
 	text-decoration: none;
 }
 
 a:hover{
-	color: #0000FF;
+	color: #FF9933;
 	text-decoration: underline;
 }
 
 h1{
  font-family: Verdana,Arial,sans-serif;
  font-size: 130%;
- color: #330099;
+ color: #116633;
  margin: 0px;
  padding: 0px;
 }
@@ -75,15 +78,15 @@ h2{
 
 h3{
  font-family: Arial, sans-serif;
- font-size: 110%;
- color: #3366CC;
+ font-size: 120%;
+ color: #AA0033;
  margin: 0px;
  padding: 0px;
 }
 
 h4{
  font-family: Verdana,Arial,sans-serif;
- font-size: 105%;
+ font-size: 100%;
  color: #334d55;
  margin: 0px;
  padding: 0px;
@@ -112,7 +115,7 @@ ul ul ul{
 label{
 	font-family: Arial, sans-serif;
 	font-size: 100%;
-	color: #334d55;
+	color: #116633;
 }
 
 .highImportance {
@@ -120,5 +123,5 @@ label{
 }
 
 .normalImportance {
-	color: #00CC00}
+	color: #009900}
 

+ 129 - 105
swi_main.pl

@@ -1,105 +1,129 @@
-#!/usr/bin/perl
-#
-#    Software Index, Copyright 2010, Software Index Project Team
-#    Link: http://swi.sourceforge.net
-#
-#    This file is part of Software Index Tool.
-#
-#    Software Index 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.
-#
-#    Software Index 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 Software Index.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-=head1 NAME
-
-Software Index - the tool measures, reports and validates software statistic,
-searches for duplications, scans for errors, 'coding style' violations
-and other configurable patterns.
-
-=head1 SYNOPSIS
-
-    perl swi_main.pl -h
-    perl swi_main.pl -help
-    perl swi_main.pl --help
-    
-    perl swi_main.pl </path/to/configuration/file.xml>
-
-=head1 OPTIONS
-
-=over 4
-
-=item -h, -help, --help
-
-Prints this help page.
-
-=item </path/to/configuration/file.xml>
-
-Full or relative path to the configuration file for the tool. Configuration file
-should include the predefined set of XML sections and tags. Use swi_config_sample.xml file
-(from the distributable package) as a 'configration file description'
-and create new configs using this file as a baseline. The sample explains every
-section in details and gives several usage examples.
-
-=back
-
-=head1 ENVIRONMENT
-
-The tool requires Perl Runtime Environment. Required Perl version is 5.6.x or later.
-
-=head1 INSTALLATION
-
-In order to install the distributive, unpack the distributable package to some folder.
-
-Software Index has internal tool (dupindex) which should be compiled for the target platform.
-By default, the distributable archive includes the compiled binary for PC Windows platform.
-Recompile it if you need (only one file dupindex.cpp), using g++ or some other C++ compiler.
-There is a project configuration file for users of Microsoft Visual Studio 2008.  
-
-=head1 COPYRIGHT 
-
-Software Index, Copyright 2009, 2010, Software Index Project Team,
-Link: http://swi.sourceforge.net
-
-=head1 LICENSE
-
-Software Index 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.
-
-Software Index 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 Software Index.  If not, see <http://www.gnu.org/licenses/>.
-
-=cut
-
-
-
-
-use strict;
-use Cwd qw(abs_path);
-use Pod::Usage;
-
-$0 =~ m/(.*)swi_main.pl$/;
-my $globalRootDirectory      = abs_path($1);
-
-push(@INC, "$globalRootDirectory/lib");
-require SWI::Launcher;
-
-if (!defined($ARGV[0]) || $ARGV[0] eq "-help" || $ARGV[0] eq "--help" || $ARGV[0] eq "-h")
-{
-    pod2usage(-exitstatus => 0, -verbose => 2);    
-}
-
-exit swiLaunch($globalRootDirectory, @ARGV);
+#!/usr/bin/perl
+#
+#    Software Index, Copyright 2010, Software Index Project Team
+#    Link: http://swi.sourceforge.net
+#
+#    This file is part of Software Index Tool.
+#
+#    Software Index 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.
+#
+#    Software Index 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 Software Index.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+=head1 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. 
+
+=head1 SYNOPSIS
+
+In order to get the context help (this text):
+
+    perl swi_main.pl -h
+    perl swi_main.pl -help
+    perl swi_main.pl --help
+    
+In order to get the sample configuration file and it's description:
+
+    perl swi_main.pl -s
+    perl swi_main.pl -sample
+    perl swi_main.pl --sample
+
+In order to launch the tool with the prepared configuration file:
+
+    perl swi_main.pl </path/to/configuration/file.xml>
+
+=head1 OPTIONS
+
+=over 4
+
+=item -h, -help, --help
+
+Prints this help page.
+
+=item -s, -sample, --sample
+
+Prints the example of configuration file and it's description.
+The sample explains every section in details and gives several usage examples.
+Use this as a start up framework for your initial configs.
+For example:
+
+    > perl swi_main.pl -sample > my_config.xml
+
+=item </path/to/configuration/file.xml>
+
+Full or relative path to the configuration file for the tool. 
+
+=back
+
+=head1 ENVIRONMENT
+
+The tool requires Perl Runtime Environment. Required Perl version is 5.6.x or later.
+
+=head1 COPYRIGHT 
+
+Software Index, Copyright 2009, 2010, Software Index Project Team,
+Link: http://swi.sourceforge.net
+
+=head1 LICENSE
+
+Software Index 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.
+
+Software Index 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 Software Index.  If not, see <http://www.gnu.org/licenses/>.
+
+=cut
+
+use strict;
+use Cwd qw(abs_path);
+use Pod::Usage;
+
+$0 =~ m/(.*)swi_main.pl$/;
+my $globalRootDirectory = abs_path($1);
+
+push( @INC, "$globalRootDirectory/lib" );
+require SWI::Launcher;
+
+if (   !defined( $ARGV[0] )
+    || $ARGV[0] eq "-help"
+    || $ARGV[0] eq "--help"
+    || $ARGV[0] eq "-h" )
+{
+    pod2usage( -exitstatus => 0, -verbose => 2 );
+    exit 0;
+}
+
+if (   !defined( $ARGV[0] )
+    || $ARGV[0] eq "-sample"
+    || $ARGV[0] eq "--sample"
+    || $ARGV[0] eq "-s" )
+{
+    my $fh = new FileHandle( "$globalRootDirectory/swi_config_sample.xml", "r" )
+      or die(
+        "Can not open input file '$globalRootDirectory/swi_config_sample.xml'!"
+      );
+
+    while (<$fh>)
+    {
+        print $_;
+    }
+    exit 0;
+}
+
+exit swiLaunch( $globalRootDirectory, @ARGV );