Browse Source

Todos done, logo done, project page under development.

avkonst 15 years ago
parent
commit
02c53015b2

BIN
dupindex/bin/dupindex.exe


BIN
images/logo.psd


BIN
images/logo_project.jpg


BIN
images/logo_project.psd


BIN
images/logo_small.gif


BIN
images/logo_small.png


+ 78 - 20
lib/SWI/Appraiser.pm

@@ -407,22 +407,40 @@ sub swiAppraise
                 }
                 print $fh "        </swi:statistic>\n";
 
-                if (
-                    defined(
-                        $report->{"swi:module"}[$moduleId]
-                          ->{"swi:file"}[$fileId]->{"swi:function"}[$functionId]
-                          ->{'swi:reference'}
-                    )
-                  )
+                my $refers =
+                  $report->{"swi:module"}[$moduleId]->{"swi:file"}[$fileId]
+                  ->{"swi:function"}[$functionId]->{'swi:reference'};
+                if ( defined($refers) )
                 {
-                    # TODO: apply suppress patterns here
-                    
-                    my $refStr = XMLout(
-                        $report->{"swi:module"}[$moduleId]
-                          ->{"swi:file"}[$fileId]->{"swi:function"}[$functionId]
-                          ->{'swi:reference'},
-                        RootName => ''
-                    );
+                    foreach my $refData ( @{$refers} )
+                    {
+                        if ( $refData->{'swi:ref:type'} eq 'scan' )
+                        {
+                            foreach my $pattern (
+                                @{
+                                    $config->{'swi:modules'}
+                                      ->{"swi:module"}[$moduleId]
+                                      ->{'swi:scanner'}->{'swi:suppress'}
+                                      ->{'swi:pattern'}
+                                }
+                              )
+                            {
+                                my $msgPattern = $pattern->{'swi:message'};
+                                my $objPattern = $pattern->{'content'};
+                                if ( $refData->{'swi:scan:message'} =~
+                                       m/$msgPattern/
+                                    && "$projectName/$moduleName/$fileName/$functionName"
+                                    =~ m/$objPattern/ )
+                                {
+                                    $refData->{'swi:scan:suppress'} = 'on';
+                                    $pattern->{'swi:used'} = 1;
+                                    last;
+                                }
+                            }
+                        }
+                    }
+
+                    my $refStr = XMLout( $refers, RootName => '' );
                     $refStr =~ s/\n/\n      /g;
                     $refStr =~ s/<anon /<swi:reference /g;
                     print $fh "      ";
@@ -678,6 +696,8 @@ sub swiAppraise
     }
     print $fh "  </swi:statistic>\n";
     print $fh "</swi:report>\n";
+    
+    swiCheckUselessPatterns($config);
 
     return 0;
 }
@@ -788,7 +808,7 @@ sub swiStatisticLevelGet
         else
         {
             STATUS(
-"Wrong settings in configuration file (<limits> section): swi:limit/$keyStat/$keySubStat/$type"
+"Wrong settings in configuration file (swi:limits section): swi:limit/$keyStat/$keySubStat/$type"
             );
             $returnResult[0] = "unresolved";
         }
@@ -808,6 +828,7 @@ sub swiStatisticLevelGet
                     if ( $isFound == 0 )
                     {
                         $returnResult[1] = $pattern->{"swi:level"};
+                        $pattern->{'swi:used'} = 1;
                         $isFound = 1;
                     }
                     else
@@ -829,8 +850,8 @@ sub swiStatisticLevelGet
             else
             {
                 STATUS(
-                "Wrong settings in configuration file (<limits/suppress> section): swi:limit/$keyStat/$keySubStat/$type: "
-                . "Level is missed in pattern for the object '$objType'"
+"Wrong settings in configuration file (swi:limits section): swi:limits/$keyStat/$keySubStat/$type: "
+                      . "Level is missed in pattern for the object '$objType'"
                 );
                 $returnResult[1] = "unresolved";
                 $returnResult[2] = "[]";
@@ -890,8 +911,8 @@ sub swiReportModificationGet
       ->{$statType};
 
     if ( $objBase->{"swi:statistic"}->{"swi:checksum"}->{"swi:source"}
-        ->{$statType} != $newCrc ||
-         $objBase->{"swi:statistic"}->{"swi:length"}->{"swi:source"}
+        ->{$statType} != $newCrc
+        || $objBase->{"swi:statistic"}->{"swi:length"}->{"swi:source"}
         ->{$statType} != $newLength )
     {
         return "modified";
@@ -905,4 +926,41 @@ sub swiReportModificationGet
     return "unmodified";
 }
 
+sub swiCheckUselessPatterns
+{
+    my $root = shift();
+    if (ref($root) eq "HASH")
+    {
+        foreach my $key (keys %{$root})
+        {
+            if ($key eq 'swi:pattern')
+            {
+                # TODO process;
+                foreach my $pattern (@{$root->{'swi:pattern'}})
+                {
+                    if (!defined($pattern->{'swi:used'}) || $pattern->{'swi:used'} == 0)
+                    {
+                        my $data = Dumper($pattern);
+                        $data =~ s/\n/ /g;
+                        $data =~ s/\s+/ /g;
+                        STATUS("Useless suppress option detected with the following content: $data");
+                    }
+                }
+                
+                return;
+            }
+            swiCheckUselessPatterns($root->{$key});         
+        }
+    }
+    elsif (ref($root) eq "ARRAY")
+    {
+        foreach (@{$root})
+        {
+            return swiCheckUselessPatterns($_);         
+        }
+    }
+    
+    return;
+}
+
 return 1;

+ 8 - 2
lib/SWI/Converter.pm

@@ -318,12 +318,18 @@ sub swiNotificationPrint
     {
         foreach my $scanData ( @{$objRefs} )
         {
-            if ( $scanData->{'swi:ref:type'} eq 'scan' )
+            if (
+                $scanData->{'swi:ref:type'} eq 'scan'
+                && !(
+                    defined( $scanData->{'swi:scan:suppress'} )
+                    && $scanData->{'swi:scan:suppress'} eq 'on'
+                )
+              )
             {
                 print $file $modLocation . "/"
                   . $scanData->{'swi:scan:file'} . ":"
                   . $scanData->{'swi:scan:line'}
-                  . ": warning: '"
+                  . ": warning: "
                   . $scanData->{'swi:scan:message'}
                   . "\n\tObject         : "
                   . $objName

+ 541 - 9
lib/SWI/Launcher.pm

@@ -96,13 +96,12 @@ sub swiLaunch
           )
         {
             STATUS( "Processing module: '"
-                  . $config->{"swi:modules"}->{"swi:module"}[$i]
-                  ->{"swi:name"} . "'." );
+                  . $config->{"swi:modules"}->{"swi:module"}[$i]->{"swi:name"}
+                  . "'." );
             my $result = swiProcess( $config, $i, $rootLocation );
             if ( $result < 0 )
             {
-                STATUS(
-                    "The are problems to report the index for the module!");
+                STATUS("The are problems to report the index for the module!");
                 $returnCode = -5;
             }
             elsif ( $result > 0 )
@@ -138,8 +137,7 @@ sub swiLaunch
         # Add average/min/max/total values and generate final XML report
         if ( swiAppraise($config) )
         {
-            STATUS(
-                "The are problems to add average/min/max/total values!");
+            STATUS("The are problems to add average/min/max/total values!");
             $returnCode = -4;
         }
         else
@@ -160,7 +158,8 @@ sub swiLaunch
         }
         elsif ( $result > 0 )
         {
-            STATUS("Report has been converted. There are exceeded limitations.");
+            STATUS(
+                "Report has been converted. There are exceeded limitations.");
             $returnCode = $result;
         }
         else
@@ -174,12 +173,545 @@ sub swiLaunch
 
 sub swiConfigurationValidate
 {
+    my $result = 0;
     $config =
       XMLin( shift(),
         ForceArray => [ "swi:module", "swi:rule", "swi:pattern" ] );
 
-    DEBUG("Configuration structure is: " . Dumper($config));
-    return 0;
+    if ( !defined( $config->{'swi:info'} ) )
+    {
+        STATUS("Wrong configuration: 'swi:info' section missed.");
+        $result++;
+    }
+    else
+    {
+        if ( !defined( $config->{'swi:info'}->{'swi:version'} ) )
+        {
+            STATUS(
+                "Wrong configuration: 'swi:info/swi:version' section missed.");
+            $result++;
+        }
+        elsif ( $config->{'swi:info'}->{'swi:version'} != 1 )
+        {
+            STATUS(
+"Wrong configuration: Unsupported version of the configuration file. Check 'swi:info/swi:version' section."
+            );
+            $result++;
+        }
+
+        if ( !defined( $config->{'swi:info'}->{'swi:project'} ) )
+        {
+            STATUS(
+                "Wrong configuration: 'swi:info/swi:project' section missed.");
+            $result++;
+        }
+        else
+        {
+            if (
+                !defined(
+                    $config->{'swi:info'}->{'swi:project'}->{'swi:name'}
+                )
+              )
+            {
+                STATUS(
+"Wrong configuration: 'swi:info/swi:project/swi:name' section missed."
+                );
+                $result++;
+            }
+            elsif ( $config->{'swi:info'}->{'swi:project'}->{'swi:name'} eq "" )
+            {
+                STATUS(
+"Wrong configuration: 'swi:info/swi:project/swi:name' is empty."
+                );
+                $result++;
+            }
+        }
+    }
+
+    if ( !defined( $config->{'swi:general'} )
+        || ref( $config->{'swi:general'} ) ne 'HASH' )
+    {
+        $config->{'swi:general'} = {};
+    }
+    if ( !defined( $config->{'swi:general'}->{'swi:debug'} )
+        || ref( $config->{'swi:general'}->{'swi:debug'} ) ne 'HASH' )
+    {
+        $config->{'swi:general'}->{'swi:debug'} = {};
+    }
+    if ( !defined( $config->{'swi:general'}->{'swi:debug'}->{'swi:enabled'} ) )
+    {
+        $config->{'swi:general'}->{'swi:debug'}->{'swi:enabled'} = 'off';
+    }
+    DEBUG_ENABLED(
+        ( $config->{'swi:general'}->{'swi:debug'}->{'swi:enabled'} eq 'on' )
+        ? 1
+        : 0
+    );
+
+    if ( !defined( $config->{'swi:modules'} )
+        || ref( $config->{'swi:modules'} ) ne 'HASH' )
+    {
+        STATUS("Wrong configuration: 'swi:modules' section missed.");
+        $result++;
+    }
+    else
+    {
+        if ( !defined( $config->{'swi:modules'}->{'swi:module'} )
+            || ref( $config->{'swi:modules'}->{'swi:module'} ) ne 'ARRAY' )
+        {
+            STATUS(
+                "Wrong configuration: 'swi:modules/swi:module' section missed."
+            );
+            $result++;
+        }
+        else
+        {
+            my $moduleId = 0;
+            foreach my $module ( @{ $config->{'swi:modules'}->{'swi:module'} } )
+            {
+                if ( !defined( $module->{'swi:name'} ) )
+                {
+                    STATUS(
+"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:name' section missed."
+                    );
+                    $result++;
+                }
+                if ( !defined( $module->{'swi:location'} ) )
+                {
+                    STATUS(
+"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:location' section missed."
+                    );
+                    $result++;
+                }
+
+                if ( !defined( $module->{'swi:files'} )
+                    || ref( $module->{'swi:files'} ) ne 'HASH' )
+                {
+                    $module->{'swi:files'} = {};
+                }
+                if ( !defined( $module->{'swi:files'}->{'swi:include'} ) )
+                {
+                    $module->{'swi:files'}->{'swi:include'} = '.*';
+                }
+                if ( !defined( $module->{'swi:files'}->{'swi:exclude'} ) )
+                {
+                    $module->{'swi:files'}->{'swi:exclude'} = '';
+                }
+
+                if ( !defined( $module->{'swi:preprocessor'} )
+                    || ref( $module->{'swi:preprocessor'} ) ne 'HASH' )
+                {
+                    $module->{'swi:preprocessor'} = {};
+                }
+                if ( !defined( $module->{'swi:preprocessor'}->{'swi:rule'} ) )
+                {
+                    $module->{'swi:preprocessor'}->{'swi:rule'} = [];
+                }
+
+                my $ruleId = 0;
+                foreach
+                  my $rule ( @{ $module->{'swi:preprocessor'}->{'swi:rule'} } )
+                {
+                    if ( !defined( $rule->{'swi:filepattern'} )
+                        || $rule->{'swi:filepattern'} eq "" )
+                    {
+                        STATUS(
+"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:preprocessor/swi:rule[$ruleId]/swi:filepattern' section missed."
+                        );
+                        $result++;
+                    }
+                    if ( !defined( $rule->{'swi:searchpattern'} )
+                        || $rule->{'swi:searchpattern'} eq "" )
+                    {
+                        STATUS(
+"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:preprocessor/swi:rule[$ruleId]/swi:searchpattern' section missed."
+                        );
+                        $result++;
+                    }
+                    if ( !defined( $rule->{'swi:replacepattern'} )
+                        || $rule->{'swi:replacepattern'} eq "" )
+                    {
+                        STATUS(
+"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:preprocessor/swi:rule[$ruleId]/swi:replacepattern' section missed."
+                        );
+                        $result++;
+                    }
+
+                    $ruleId++;
+                }
+
+                if ( !defined( $module->{'swi:scanner'} )
+                    || ref( $module->{'swi:scanner'} ) ne 'HASH' )
+                {
+                    $module->{'swi:scanner'} = {};
+                }
+                if ( !defined( $module->{'swi:scanner'}->{'swi:rule'} ) )
+                {
+                    $module->{'swi:scanner'}->{'swi:rule'} = [];
+                }
+
+                $ruleId = 0;
+                foreach my $rule ( @{ $module->{'swi:scanner'}->{'swi:rule'} } )
+                {
+                    if ( !defined( $rule->{'swi:filepattern'} )
+                        || $rule->{'swi:filepattern'} eq "" )
+                    {
+                        STATUS(
+"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:rule[$ruleId]/swi:filepattern' section missed."
+                        );
+                        $result++;
+                    }
+                    if ( !defined( $rule->{'swi:searchpattern'} )
+                        || $rule->{'swi:searchpattern'} eq "" )
+                    {
+                        STATUS(
+"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:rule[$ruleId]/swi:searchpattern' section missed."
+                        );
+                        $result++;
+                    }
+                    if ( !defined( $rule->{'swi:messagepattern'} )
+                        || $rule->{'swi:messagepattern'} eq "" )
+                    {
+                        STATUS(
+"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:rule[$ruleId]/swi:messagepattern' section missed."
+                        );
+                        $result++;
+                    }
+
+                    if ( !defined( $rule->{'swi:codecontent'} )
+                        || $rule->{'swi:codecontent'} eq "" )
+                    {
+                        $rule->{'swi:codecontent'} = 'purified';
+                    }
+
+                    $ruleId++;
+                }
+
+                if ( !defined( $module->{'swi:scanner'}->{'swi:suppress'} ) )
+                {
+                    $module->{'swi:scanner'}->{'swi:suppress'} = {};
+                }
+                if (
+                    !defined(
+                        $module->{'swi:scanner'}->{'swi:suppress'}
+                          ->{'swi:pattern'}
+                    )
+                  )
+                {
+                    $module->{'swi:scanner'}->{'swi:suppress'}
+                      ->{'swi:pattern'} = [];
+                }
+
+                my $patternId = 0;
+                foreach my $pattern (
+                    @{
+                        $module->{'swi:scanner'}->{'swi:suppress'}
+                          ->{'swi:pattern'}
+                    }
+                  )
+                {
+                    if ( ref($pattern) ne 'HASH' )
+                    {
+                        STATUS(
+"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:suppress/swi:pattern[$patternId]' section is incorrect."
+                        );
+                        $result++;
+                    }
+                    else
+                    {
+                        if ( !defined( $pattern->{'swi:message'} )
+                            || $pattern->{'swi:message'} eq "" )
+                        {
+                            STATUS(
+"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:suppress/swi:pattern[$patternId]/swi:message' field is empty."
+                            );
+                            $result++;
+                        }
+                        if ( !defined( $pattern->{'content'} )
+                            || $pattern->{'content'} eq "" )
+                        {
+                            STATUS(
+"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:suppress/swi:pattern[$patternId]' object pattern is empty."
+                            );
+                            $result++;
+                        }
+                    }
+
+                    $patternId++;
+                }
+
+                if ( !defined( $module->{'swi:indexer:common'} )
+                    || ref( $module->{'swi:indexer:common'} ) ne 'HASH' )
+                {
+                    $module->{'swi:indexer:common'} = {};
+                }
+
+                if ( !defined( $module->{'swi:indexer:dup'} )
+                    || ref( $module->{'swi:indexer:dup'} ) ne 'HASH' )
+                {
+                    $module->{'swi:indexer:dup'} = {};
+                }
+                if (
+                    !defined(
+                        $module->{'swi:indexer:dup'}->{'swi:codecontent'}
+                    )
+                  )
+                {
+                    $module->{'swi:indexer:dup'}->{'swi:codecontent'} =
+                      'purified';
+                }
+                if ( !defined( $module->{'swi:indexer:dup'}->{'swi:enabled'} ) )
+                {
+                    $module->{'swi:indexer:dup'}->{'swi:enabled'} = 'off';
+                }
+                if ( !defined( $module->{'swi:indexer:dup'}->{'swi:minlength'} )
+                  )
+                {
+                    $module->{'swi:indexer:dup'}->{'swi:minlength'} = 100;
+                }
+                if ( $module->{'swi:indexer:dup'}->{'swi:minlength'} <= 0 )
+                {
+                    STATUS(
+"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:indexer:dup/swi:minlength' can not be less than or equal to zero."
+                    );
+                    $result++;
+                }
+                if ( !defined( $module->{'swi:indexer:dup'}->{'swi:proximity'} )
+                  )
+                {
+                    $module->{'swi:indexer:dup'}->{'swi:proximity'} = 100;
+                }
+                if (   $module->{'swi:indexer:dup'}->{'swi:proximity'} <= 0
+                    || $module->{'swi:indexer:dup'}->{'swi:proximity'} > 100 )
+                {
+                    STATUS(
+"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:indexer:dup/swi:proximity' should be in the range from 1 till 100."
+                    );
+                    $result++;
+                }
+                if (
+                    !defined(
+                        $module->{'swi:indexer:dup'}->{'swi:globalcode'}
+                    )
+                  )
+                {
+                    $module->{'swi:indexer:dup'}->{'swi:globalcode'} = 'off';
+                }
+
+                $moduleId++;
+            }
+        }
+    }
+
+    if ( !defined( $config->{'swi:report'} )
+        || ref( $config->{'swi:report'} ) ne 'HASH' )
+    {
+        STATUS("Wrong configuration: 'swi:report' section missed.");
+        $result++;
+    }
+    else
+    {
+        if ( !defined( $config->{'swi:report'}->{'swi:destination'} ) )
+        {
+            STATUS(
+"Wrong configuration: 'swi:report/swi:destination' section missed."
+            );
+            $result++;
+        }
+
+        if ( !defined( $config->{'swi:report'}->{'swi:xml'} ) )
+        {
+            STATUS("Wrong configuration: 'swi:report/swi:xml' section missed.");
+            $result++;
+        }
+        else
+        {
+            if (
+                !defined( $config->{'swi:report'}->{'swi:xml'}->{'swi:name'} ) )
+            {
+                STATUS(
+"Wrong configuration: 'swi:report/swi:xml/swi:name' section is empty."
+                );
+                $result++;
+            }
+        }
+
+        if ( !defined( $config->{'swi:report'}->{'swi:notifications'} ) )
+        {
+            STATUS(
+"Wrong configuration: 'swi:report/swi:notifications' section missed."
+            );
+            $result++;
+        }
+        else
+        {
+            if (
+                !defined(
+                    $config->{'swi:report'}->{'swi:notifications'}->{'swi:name'}
+                )
+              )
+            {
+                STATUS(
+"Wrong configuration: 'swi:report/swi:notifications/swi:name' section is empty."
+                );
+                $result++;
+            }
+
+            if (
+                !defined(
+                    $config->{'swi:report'}->{'swi:notifications'}
+                      ->{'swi:error'}
+                )
+                || ref(
+                    $config->{'swi:report'}->{'swi:notifications'}
+                      ->{'swi:error'}
+                ) ne 'HASH'
+              )
+            {
+                $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'} =
+                  {};
+            }
+            if (
+                !defined(
+                    $config->{'swi:report'}->{'swi:notifications'}
+                      ->{'swi:error'}->{'swi:added'}
+                )
+              )
+            {
+                $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
+                  ->{'swi:added'} = 'on';
+            }
+            if (
+                !defined(
+                    $config->{'swi:report'}->{'swi:notifications'}
+                      ->{'swi:error'}->{'swi:removed'}
+                )
+              )
+            {
+                $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
+                  ->{'swi:removed'} = 'on';
+            }
+            if (
+                !defined(
+                    $config->{'swi:report'}->{'swi:notifications'}
+                      ->{'swi:error'}->{'swi:modified'}
+                )
+              )
+            {
+                $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
+                  ->{'swi:modified'} = 'on';
+            }
+            if (
+                !defined(
+                    $config->{'swi:report'}->{'swi:notifications'}
+                      ->{'swi:error'}->{'swi:cloned'}
+                )
+              )
+            {
+                $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
+                  ->{'swi:cloned'} = 'on';
+            }
+            if (
+                !defined(
+                    $config->{'swi:report'}->{'swi:notifications'}
+                      ->{'swi:error'}->{'swi:unmodified'}
+                )
+              )
+            {
+                $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
+                  ->{'swi:unmodified'} = 'on';
+            }
+
+            if (
+                !defined(
+                    $config->{'swi:report'}->{'swi:notifications'}
+                      ->{'swi:print'}
+                )
+                || ref(
+                    $config->{'swi:report'}->{'swi:notifications'}
+                      ->{'swi:print'}
+                ) ne 'HASH'
+              )
+            {
+                $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'} =
+                  {};
+            }
+            swiUtilConfigFill_PrintSection($config, 'swi:added');
+            swiUtilConfigFill_PrintSection($config, 'swi:removed');
+            swiUtilConfigFill_PrintSection($config, 'swi:modified');
+            swiUtilConfigFill_PrintSection($config, 'swi:cloned');
+            swiUtilConfigFill_PrintSection($config, 'swi:unmodified');
+            
+        }
+    }
+    
+    # swi:limits section is verified in runtime
+    # no precheck currently 
+
+    DEBUG( "Configuration structure is: " . Dumper($config) );
+    return $result;
+}
+
+sub swiUtilConfigFill_PrintSection
+{
+    my $config  = shift();
+    my $modType = shift();
+
+    if (
+        !defined(
+            $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
+              ->{$modType}
+        )
+        || ref(
+            $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
+              ->{$modType}
+        ) ne 'HASH'
+      )
+    {
+        $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
+          ->{$modType} = {};
+    }
+    
+    if (
+        !defined(
+            $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
+              ->{$modType}->{'swi:failures'}
+        )
+      )
+    {
+        $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
+          ->{$modType}->{'swi:failures'} = 'on';
+    }
+    if (
+        !defined(
+            $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
+              ->{$modType}->{'swi:modifications'}
+        )
+      )
+    {
+        $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
+          ->{$modType}->{'swi:modifications'} = 'on';
+    }
+    if (
+        !defined(
+            $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
+              ->{$modType}->{'swi:duplications'}
+        )
+      )
+    {
+        $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
+          ->{$modType}->{'swi:duplications'} = 'on';
+    }
+    if (
+        !defined(
+            $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
+              ->{$modType}->{'swi:scanmessages'}
+        )
+      )
+    {
+        $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
+          ->{$modType}->{'swi:scanmessages'} = 'on';
+    }
 }
 
 return 1;

+ 4 - 5
lib/SWI/Processor.pm

@@ -232,8 +232,7 @@ sub swiProcess
         {
             if ( $file =~ m/$swiGlobalInclude/ )
             {
-                if (   defined($swiGlobalExclude)
-                    && $swiGlobalExclude ne ""
+                if ($swiGlobalExclude ne ""
                     && $file =~ m/$swiGlobalExclude/ )
                 {
                     next;
@@ -1094,13 +1093,13 @@ m/^($regexpCodeFunctionModifier)*($regexpCodeFunctionIdentifier)($regexpCodeFunc
                             PRINT( $file, $currentLine + 1, 'debug',
 "The same function detected more than once: '$word'"
                             );
-                            my $counter = 1;
+                            my $counter = 2;
                             while (
-                                defined( $result->{ $word . ":" . $counter } ) )
+                                defined( $result->{ $word . " (" . $counter . ")" } ) )
                             {
                                 $counter++;
                             }
-                            $word .= ":" . $counter;
+                            $word .= " (" . $counter . ")";
                         }
 
                         # Store data in result

+ 119 - 0
project.html

@@ -0,0 +1,119 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<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
+    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,
+    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/>.
+
+-->
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-5" />
+<title>ExecKit Project</title>
+<link href="style.css" rel="stylesheet" type="text/css" />
+</head>
+
+<body>
+<table border="0" align="center" cellpadding="0" cellspacing="0" width="1000">
+  <tr>
+    <td>&nbsp;</td>
+    <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>
+  </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>
+          <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>
+          </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>
+          <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 />
+            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.,
+            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="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>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>
+          </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>
+          <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><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>
+          <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>
+      </tr>
+    </table>
+        <h3>&nbsp;</h3></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>
+    </div></td>
+  </tr>
+</table>
+<p></p>
+</body>
+</html>

+ 124 - 0
style.css

@@ -0,0 +1,124 @@
+/*
+
+    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/>.
+ 
+*/
+
+/***********************************************/
+/* HTML tag styles                             */
+/***********************************************/ 
+
+body{
+	font-family: Arial, sans-serif;
+	color: #333333;
+	line-height: 1.166;
+	margin: 0px;
+	padding: 0px;
+	font-size: 14px;
+}
+
+td{
+	background-position: left;
+	background-repeat: no-repeat;
+}
+
+a{
+	color: #3399FF;
+	text-decoration: none;
+}
+
+a:link{
+	color: #3399FF;
+	text-decoration: none;
+}
+
+a:visited{
+	color: #3399FF;
+	text-decoration: none;
+}
+
+a:hover{
+	color: #0000FF;
+	text-decoration: underline;
+}
+
+h1{
+ font-family: Verdana,Arial,sans-serif;
+ font-size: 130%;
+ color: #330099;
+ margin: 0px;
+ padding: 0px;
+}
+
+h2{
+ font-family: Arial,sans-serif;
+ font-size: 120%;
+ color: #330099;
+ margin: 0px;
+ padding: 0px;
+}
+
+h3{
+ font-family: Arial, sans-serif;
+ font-size: 110%;
+ color: #3366CC;
+ margin: 0px;
+ padding: 0px;
+}
+
+h4{
+ font-family: Verdana,Arial,sans-serif;
+ font-size: 105%;
+ color: #334d55;
+ margin: 0px;
+ padding: 0px;
+}
+
+h5{
+ margin: 0px;
+ padding: 0px;
+ font-family: Verdana,Arial,sans-serif;
+ font-size: 100%;
+ color: #334d55;
+}
+
+ul{
+ list-style-type: disc;
+}
+
+ul ul{
+ list-style-type: circle;
+}
+
+ul ul ul{
+ list-style-type: disc;
+}
+
+label{
+	font-family: Arial, sans-serif;
+	font-size: 100%;
+	color: #334d55;
+}
+
+.highImportance {
+	color: #FF0000
+}
+
+.normalImportance {
+	color: #00CC00}
+

+ 144 - 71
swi_config_sample.xml

@@ -1,22 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+
 <!--
    
     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/>.
-   
+    
 -->
 
 <!--
@@ -30,9 +32,6 @@
     Some of them demostrates usage examples.
 -->
 
-
-<?xml version="1.0" encoding="utf-8"?>
-
 <!-- Root node 'swi:configuration' is mandatory. It's name is hardcoded. -->
 <swi:configuration>
 
@@ -57,6 +56,8 @@
         This section for tracing purposes.
         If you workflow assumes history records in project files,
         this is the place to keep your records
+        
+        The section can be missed.
     -->
     <swi:history>
       <!-- Section 'swi:revision' can be repeated several times -->
@@ -75,7 +76,29 @@
       -->
     </swi:history>
   </swi:info>
-
+  
+  <!--
+      The 'swi:general' section configures global settings for the tool.
+      
+      The section can be missed.
+  -->
+  <swi:general>
+    <!--
+        Filtering of the debug information
+        
+        The section can be missed.
+    -->
+    <swi:debug>
+     <!--
+         The 'swi:enabled' option activates/deativates the tracing:
+         Possible values are 'on' and 'off'
+         
+         By default, the debug is not enabled.
+      -->
+      <swi:enabled>off</swi:enabled>
+    </swi:debug>
+  </swi:general>
+  
   <!-- Section 'swi:modules' define where to get sources and how to process them. -->
   <swi:modules>
     <!-- Section 'swi:module' can be repeated several times -->
@@ -95,7 +118,11 @@
           If it is relative path, you need to run Software Index tool from the relatively correct folder.
       -->
       <swi:location>/path/to/my/module</swi:location>
-      <!-- Section 'swi:files' which files to process and which to miss -->
+      <!--
+          Section 'swi:files' which files to process and which to miss.
+          
+          The section can be missed.
+      -->
       <swi:files>
         <!--
             This option is a regular expression.
@@ -104,6 +131,8 @@
             Otherwise, it is missed and not touched by Software Index tool.
             The example below matches files with the following extensions:
             .c, .h, .cpp, .hpp
+            
+            By default, all files are included.
         -->
         <swi:include>^.*[.][chCH]([pP][pP])?$</swi:include>
         <!--
@@ -113,6 +142,8 @@
             (even if it was previously mathced by the previous option).
             The example below matches files with the following extensions:
             .gz.c, .gz.h, .gz.cpp, .gz.hpp
+            
+            By default, no files are excluded.
         -->
         <swi:exclude>^.*[.][gG][zZ][.][chCH]([pP][pP])?$</swi:exclude>
       </swi:files>
@@ -201,7 +232,7 @@
               line 19: }
               line 20: 
           Software Index tool detects function DECLARE_HANDLER twice. As a result, they will be named:
-              'DECLARE_HANDLER' and 'DECLARE_HANDLER:1' accordingly.
+              'DECLARE_HANDLER' and 'DECLARE_HANDLER (2)' accordingly.
           
           The better solution is to preprocess these strings using the preprocessor feature.
           For this particular example, it is recommended to define the rule which replaces the string:
@@ -218,9 +249,11 @@
               </swi:rule>
           As a result, the functions will be detected with the correct names:
               'leftButtonClick' and 'rightButtonClick' accordingly.
+          
+          'swi:preprocessor' section can be missed.
       -->
       <swi:preprocessor>
-        <!-- Section 'swi:rule' can be repeated several times -->
+        <!-- Section 'swi:rule' can be missed or repeated several times -->
         <swi:rule>
           <!--
               This option is a regular expression.
@@ -292,9 +325,11 @@
               Noname '$2' detected.
           the error report looks like this:
               file.c:2: warning: Noname 'struct' detected.
+              
+          'swi:scaner' section can be missed.
       -->
       <swi:scanner>
-        <!-- Section 'swi:rule' can be repeated several times -->
+        <!-- Section 'swi:rule' can be missed or repeated several times -->
         <swi:rule>
           <!--
               This option is a regular expression.
@@ -313,22 +348,22 @@
           -->
           <swi:searchpattern>(\s+)((union)|(enum)|(struct))(\s*{)</swi:searchpattern>
           <swi:messagepattern>Noname '$2' detected.</swi:messagepattern>
-      	  <!--
-      	      The 'swi:codecontent' option defines the content for scanner, it can be:
-      	    
-      	          initial         - the initial source content
-      	          code            - the initial code (without comments)
-      	          comments        - comments only (no code)
-      	          nopreprocessor  - preprocessor strings excluded (without comments and preprocessor)
-      	          nostrings       - strings excluded (without comments and strings)
-      	          purified        - strings and preprocessor excluded (without comments, strings and preprocessor)
+            <!--
+                The 'swi:codecontent' option defines the content for scanner, it can be:
+              
+                  initial         - the initial source content
+                  code            - the initial code (without comments)
+                  comments        - comments only (no code)
+                  nopreprocessor  - preprocessor strings excluded (without comments and preprocessor)
+                  nostrings       - strings excluded (without comments and strings)
+                  purified        - strings and preprocessor excluded (without comments, strings and preprocessor)
                   commentheader   - comments before function's header
-      	          functionname    - name of a function
+                  functionname    - name of a function
                   functionhead    - purified function's header, no body
                   functionbody    - purified function's body, no header
-      	    
-      	      By default, the 'purified' code is scanned
-      	  -->
+              
+                By default, the 'purified' code is scanned
+            -->
           <swi:codecontent>purified</swi:codecontent>
         </swi:rule>
         <!--
@@ -341,6 +376,30 @@
               <swi:codecontent>nostrings</swi:codecontent>
             </swi:rule>
         -->
+        <!--
+            If some finding is acceptable and should not be considered as a violation
+            it is possible to define the exception and suppress the notification
+            in the 'swi:suppress' section below.
+        -->
+        <swi:suppress>
+          <!--
+              The exception should be defined in combination with 'swi:message' option.
+              If a scanner's message is matched by the regular expression 'swi:message'
+              and the object is matched by the regular expression in 'swi:pattern' tag,
+              the finding is ignored and not printed to the log and stderr streams.
+              
+              For example, the following pattern blocks the notification:
+                  'Noname 'enum' detected.'
+              for the object:
+                  YOUR_PROJECT_NAME/YOUR_MODULE_NAME/your_file.c/yourFunction
+          -->
+          <swi:pattern swi:message="Noname 'enum' detected.">^YOUR_PROJECT_NAME/YOUR_MODULE_NAME/your_file.c/yourFunction$</swi:pattern>
+          <!--
+              Add here the next 'swi:pattern' section, for example:
+              <swi:pattern swi:message="Noname 'struct' detected.">^.*/.*/file2.c/function2$</swi:pattern>
+          -->
+        </swi:suppress>
+        
       </swi:scanner>
       
       <!--
@@ -368,7 +427,7 @@
               swi:checksum    / swi:source         - Checksum for the source code (compare purposes)
               
           Every statistic is reported incombination with the following types:
-
+          
               STATICTIC-TYPE  - DESCRIPTION
               =============== - ============================
               swi:exact       - exact value
@@ -378,18 +437,20 @@
               swi:total       - sum of values within a distribution
               
           Cumulative types (swi:average, swi:min, swi:max and swi:total) are reported if they are applicable.
+          
+          'swi:indexer:common' section can be missed.
       -->
       <swi:indexer:common>
         <!-- No settings currently available -->
       </swi:indexer:common>
       
-	  <!--
-	      Duplication indexer searches for identical code fragments, calculates total number of symbols
-		  in continues duplicated fragments per function, file, module and project.
+      <!--
+          Duplication indexer searches for identical code fragments, calculates total number of symbols
+          in continues duplicated fragments per function, file, module and project.
           
           Note: blank symbols (spaces, tabulations, newlines) are ignored when strings are compared.
-		  
-		  The duplciation statistic is reported by reference 'swi:duplication/swi:symbols':
+          
+          The duplciation statistic is reported by reference 'swi:duplication/swi:symbols':
           
               STATICTIC-GROUP / STATISTIC-NAME     - DESCRIPTION
               =============== / ================== - ============================
@@ -406,51 +467,55 @@
               swi:total       - sum of values within a distribution
               
           Cumulative types (swi:average, swi:min, swi:max and swi:total) are reported if they are applicable.
-		  
-		  This internal tool also collects pointers to duplicated fragments and prints them.
-		  Also, they can be easily extracted from the final report for other needs.
-	  -->
+          
+          This internal tool also collects pointers to duplicated fragments and prints them.
+          Also, they can be easily extracted from the final report for other needs.
+          
+          'swi:indexer:dup' section can be missed.
+      -->
       <swi:indexer:dup>
-      	<!--
-      	    The 'swi:codecontent' option defines the content for the duplicatiion searcher, it can be:
-      	    
-      	        initial         - the initial source content
-      	        code            - the initial code (without comments)
-      	        comments        - comments only (no code)
-      	        nopreprocessor  - preprocessor strings excluded (without comments and preprocessor)
-      	        nostrings       - strings excluded (without comments and strings)
-      	        purified        - strings and preprocessor excluded (without comments, strings and preprocessor)
+        <!--
+            The 'swi:codecontent' option defines the content for the duplicatiion searcher, it can be:
+            
+                initial         - the initial source content
+                code            - the initial code (without comments)
+                comments        - comments only (no code)
+                nopreprocessor  - preprocessor strings excluded (without comments and preprocessor)
+                nostrings       - strings excluded (without comments and strings)
+                purified        - strings and preprocessor excluded (without comments, strings and preprocessor)
                 commentheader   - comments before function's header
                 functionname    - name of a function
                 functionhead    - purified function's header, no body
                 functionbody    - purified function's body, no header
-      	    
-      	    By default, the 'purified' content is used.
+              
+              By default, the 'purified' content is used.
             
             Recomendation: if Software Index tool detects a log of duplicated fragments
             which are within function's header (declarations), usually it is the case when
             where are overloaded functions with a huge list of arguments, it is recommended
             to set 'swi:codecontent' option to 'functionbody' value.
-      	-->
-      	<swi:codecontent>purified</swi:codecontent>
-      	<!--
-      	    The 'swi:enabled' option activates/deativates the calculation of the duplication index:
-      	    
-      	        on  - the search tool is launched and the statistic is calculated
-      	        off - the search tool is not started, the statistic is reported by zeros
-      	    
-      	    By default, the this is not enabled
-      	-->
+        -->
+        <swi:codecontent>purified</swi:codecontent>
+        <!--
+            The 'swi:enabled' option activates/deativates the calculation of the duplication index:
+            
+                on  - the search tool is launched and the statistic is calculated
+                off - the search tool is not started, the statistic is reported by zeros
+            
+            By default, the this is not enabled
+        -->
         <swi:enabled>on</swi:enabled>
-      	<!--
-      	    The 'swi:minlength' option defines the minimal length of the duplicated fragment.
+          <!--
+            The 'swi:minlength' option defines the minimal length of the duplicated fragment.
             In other words, if the duplicated fragment is found it is at least 'swi:minlength' in length
             Too small value, for example 10, results in excessive growth of the total duplication index
             Too large value may cause the empty search result.
-      	-->
+            
+            By default, it is equal to 100.
+          -->
         <swi:minlength>100</swi:minlength>
-      	<!--
-      	    The 'swi:proximity' option allows to report two code fragments as duplicated
+        <!--
+            The 'swi:proximity' option allows to report two code fragments as duplicated
             even if they are not matched exactly till the end.
             It helps to search 'almost' duplicated code fragments instead of 'exactly' duplicated.
             
@@ -460,7 +525,9 @@
             which are 100 symbols in length and 'swi:proximity' is equal to 80,
             this group will be extended by other found code fragments
             which have 80 or more the same symbols.
-      	-->
+            
+            By default, it is equal to 100.
+        -->
         <swi:proximity>100</swi:proximity>
         <!--
             All code fragments are related to some function.
@@ -469,11 +536,11 @@
             
             The 'swi:globalcode' configures whether the global code should be included
             to the scope of search for duplication.
-
-      	        on  - global code is scaned for duplication
-      	        off - global code is missed
-      	    
-      	    By default, the this option is 'off'.
+            
+                on  - global code is scaned for duplication
+                off - global code is missed
+            
+            By default, the this option is 'off'.
         -->
         <swi:globalcode>on</swi:globalcode>
       </swi:indexer:dup>
@@ -564,8 +631,8 @@
           Thus, if there are no notifications/errors, exit code is zero.
           
           Options should be equal to some value from the list below:
-      	      on  - counter is increased
-      	      off - counter is not increased
+                on  - counter is increased (selected by default for all)
+                off - counter is not increased
           
           Example 1: 'easy deployment of the tool'
               added      - 'on'
@@ -587,6 +654,8 @@
               modified   - 'off'
               cloned     - 'off'
               unmodified - 'off'
+              
+          'swi:error' section can be missed.
       -->
       <swi:error>
         <swi:added>on</swi:added>
@@ -609,6 +678,8 @@
                                     (see 'swi:scaner' section above)
           
           (*) marks types of messages which affect the exit code (see 'swi:error' section above).
+          
+          'swi:print' section can be missed. In this case all messages are activated by default.
       -->
       <swi:print>
         <swi:added>
@@ -652,6 +723,8 @@
       Limits should be defined per:
       STATISTIC-GROUP / STATISTIC-NAME / STATISTIC-TYPE
       (See sections 'swi:indexer:common' and 'swi:indexer:dup' above)
+      
+      'swi:limits' section can be missed.
   -->
   <swi:limits>
     <!-- 
@@ -735,7 +808,7 @@
                 <swi:pattern swi:level="warning">^.*/.*/file2.c/operator new[]$</swi:pattern>
             -->
           </swi:suppress>
-	  
+      
         </swi:exact>
       </swi:comment:header>
 

+ 14 - 6
test/swi_config_ddd.xml

@@ -14,7 +14,13 @@
       </swi:revision>
     </swi:history>
   </swi:info>
-      
+  
+  <swi:general>
+    <swi:debug>
+       <swi:enabled>off</swi:enabled>
+    </swi:debug>
+  </swi:general>
+  
   <swi:modules>
     <swi:module>
       <swi:name>DDD-SOURCES</swi:name>
@@ -69,10 +75,11 @@
         </swi:rule>
 
         <swi:suppress>
-          <swi:pattern swi:message="Message pattern">Object pattern</swi:pattern>
+          <swi:pattern swi:message="Noname 'struct'">.*</swi:pattern>
+          <swi:pattern swi:message="Noname 'useless'">.*</swi:pattern>
         </swi:suppress>
 
-        </swi:scanner>
+      </swi:scanner>
       
       <swi:indexer:common>
         <!-- No settings currently available -->
@@ -173,11 +180,12 @@
           <swi:info>0.28</swi:info>
           <swi:notice>0.40</swi:notice>
           <swi:warning>0.60</swi:warning>
-          <!--
+          
+          
           <swi:suppress>
-              <swi:pattern swi:level="warning">.*</swi:pattern>
+              <swi:pattern swi:level="warning">Useless pattern</swi:pattern>
           </swi:suppress>
-          -->
+          
         </swi:exact>
       </swi:symbols>
     </swi:duplication>