<commit_before><?xml version="1.0"?>
<ruleset name="PMD ruleset for Checkstyle"
        xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0
                            http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
  <description>
    PMD common ruleset for Checkstyle main/test sourcesets
  </description>

  <rule ref="category/java/bestpractices.xml">
    <!-- We do not care about this minor overhead, we are not Android application and we do not
         want to change visibility of methods. Package-private visibility should be avoid almost
         always. -->
    <exclude name="AccessorMethodGeneration"/>
    <!-- The PMD mistakes the AbstractViolationReporter::log() as a debug log. -->
    <exclude name="GuardLogStatement"/>
  </rule>
  <rule ref="category/java/bestpractices.xml/AvoidPrintStackTrace">
    <properties>
      <!-- It is ok to use print stack trace in CLI class. -->
      <property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[@Image='Main']"/>
    </properties>
  </rule>
  <rule ref="category/java/bestpractices.xml/JUnitAssertionsShouldIncludeMessage">
    <properties>
      <!-- The PMD check accepts only a string constant as the assert message.
           This check uses a method call. -->
      <property name="violationSuppressXPath"
                value="//ClassOrInterfaceDeclaration[@Image='JavadocCatchCheck']
                           //MethodDeclaration[@Name='visitJavadocToken']"/>
    </properties>
  </rule>
  <rule ref="category/java/bestpractices.xml/SystemPrintln">
    <properties>
      <!-- it is ok to use println in CLI class. -->
      <property name="violationSuppressXPath"
                value="//ClassOrInterfaceDeclaration
                       [@Image='Main' or @Image='Main$CliOptions'
                       or @Image='JavadocPropertiesGenerator']"/>
    </properties>
  </rule>

  <rule ref="category/java/documentation.xml">
    <!-- We use class comments as source for xdoc files,
         so content is big and that is by design. -->
    <exclude name="CommentSize"/>
  </rule>
  <rule ref="category/java/documentation.xml/CommentRequired">
    <properties>
      <!-- *TokenTypes are special class, comments are as trailing comments.
           RequireThisCheck$AbstractFrame is a private class, no comment is required.
           Main.runCli has a false positive for an anonymous class.
      -->
      <property name="violationSuppressXPath"
                value="//ClassOrInterfaceDeclaration[@Image='JavadocTokenTypes']
      | //ClassOrInterfaceDeclaration[@Image='RequireThisCheck']
      | //ClassOrInterfaceDeclaration[@Image='AbstractFrame']
      | //ClassOrInterfaceDeclaration[@Image='Main']//MethodDeclaration[@Name='runCli']"/>
    </properties>
  </rule>

  <rule ref="category/java/codestyle.xml">
    <!-- Opposite to UnnecessaryConstructor. -->
    <exclude name="AtLeastOneConstructor"/>
    <!-- Turning a local variable to the field may create design problems and extend the scope of
           the variable. -->
    <exclude name="AvoidFinalLocalVariable"/>
    <!-- Conflicts with names that does not mean in/out. -->
    <exclude name="AvoidPrefixingMethodParameters"/>
    <!-- Calling super() is completely pointless, no matter if class inherits anything or not;
         it is meaningful only if you do not call implicit constructor of the base class. -->
    <exclude name="CallSuperInConstructor"/>
    <!-- Pollutes code with modifiers. -->
    <exclude name="LocalVariableCouldBeFinal"/>
    <!-- Pollutes the code with modifiers. We use the ParameterAssignmentCheck to protect the
         parameters. -->
    <exclude name="MethodArgumentCouldBeFinal"/>
    <!-- It is possible only in functional languages and fanatically-pristine code, without
         additional option that are done at ReturnCountExtendedCheck it is not a good rule. -->
    <exclude name="OnlyOneReturn"/>
    <!-- We use CheckstyleCustomShortVariable, to control the length and skip Override methods. -->
    <exclude name="ShortVariable"/>
    <!-- Till https://github.com/checkstyle/checkstyle/issues/6579 -->
    <exclude name="UseUnderscoresInNumericLiterals"/>
  </rule>
  <rule ref="category/java/codestyle.xml/ClassNamingConventions">
    <properties>
     <property name="classPattern" value="[A-Z][a-zA-Z0-9]*" />
     <property name="abstractClassPattern" value="Abstract[A-Z][a-zA-Z0-9]*" />
     <property name="interfacePattern" value="[A-Z][a-zA-Z0-9]*" />
     <property name="enumPattern" value="[A-Z][a-zA-Z0-9]*" />
     <property name="annotationPattern" value="[A-Z][a-zA-Z0-9]*" />
     <property name="utilityClassPattern" value="[A-Z][a-zA-Z0-9]*Util" />
     <!-- We can not brake compatibility with previous versions. -->
     <property name="violationSuppressXPath"
               value="//ClassOrInterfaceDeclaration
                          [@Image='AbstractClassNameCheck' or @Image='AutomaticBean']"/>
    </properties>
  </rule>
  <rule ref="category/java/codestyle.xml/ClassNamingConventions">
    <properties>
     <!-- Definitions and XmlLoader.LoadExternalDtdFeatureProvider aren't utility classes.
          JavadocTokenTypes and TokenTypes aren't utility classes.
            They are token definition classes. Also, they are part of the API. -->
     <property name="violationSuppressXPath"
               value="//ClassOrInterfaceDeclaration[@Image='Definitions'
                   or @Image='JavadocTokenTypes' or @Image='TokenTypes'
                   or @Image='LoadExternalDtdFeatureProvider']"/>
    </properties>
  </rule>
  <rule ref="category/java/codestyle.xml/ConfusingTernary">
    <properties>
      <!-- False positives on IF_ELSE-IF-ELSE-IF. -->
      <property name="violationSuppressXPath"
                value="//ClassOrInterfaceDeclaration[@Image='XMLLogger']
                           //MethodDeclarator[@Image='isReference']
      | //ClassOrInterfaceDeclaration[@Image='DetailAST']
              //MethodDeclarator[@Image='addPreviousSibling']
      | //ClassOrInterfaceDeclaration[@Image='AnnotationLocationCheck']
              //MethodDeclarator[@Image='checkAnnotations']
      | //ClassOrInterfaceDeclaration[@Image='AbstractImportControl']
              //MethodDeclarator[@Image='checkAccess']
      | //ClassOrInterfaceDeclaration[@Image='HandlerFactory']
              //MethodDeclarator[@Image='getHandler']"/>
    </properties>
  </rule>
  <rule ref="category/java/codestyle.xml/EmptyMethodInAbstractClassShouldBeAbstract">
    <properties>
      <!-- Can not change the API. -->
      <property name="violationSuppressXPath"
                value="//ClassOrInterfaceDeclaration[@Image='AbstractFileSetCheck'
        or @Image='AbstractCheck' or @Image='AbstractJavadocCheck' or @Image='AbstractNode'
        or @Image='AbstractViolationReporter']"/>
    </properties>
  </rule>
  <rule ref="category/java/codestyle.xml/LongVariable">
    <properties>
      <!-- Nothing bad with the long and descriptive variable names if only they fit the line,
           but still keep it reasonable. -->
      <property name="minimum" value="45"/>
    </properties>
  </rule>
  <rule ref="category/java/codestyle.xml/ShortClassName">
    <properties>
      <!-- Main is a good name for the class containing the main method.
           Tag as inner class name is fine. -->
      <property name="violationSuppressXPath"
                value="//ClassOrInterfaceDeclaration[@Image='Main' or @Image='Tag']"/>
    </properties>
  </rule><commit_msg>Issue #6579: Enable PMD rule UseUnderscoresInNumericLiterals<commit_after><?xml version="1.0"?>
<ruleset name="PMD ruleset for Checkstyle"
        xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0
                            http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
  <description>
    PMD common ruleset for Checkstyle main/test sourcesets
  </description>

  <rule ref="category/java/bestpractices.xml">
    <!-- We do not care about this minor overhead, we are not Android application and we do not
         want to change visibility of methods. Package-private visibility should be avoid almost
         always. -->
    <exclude name="AccessorMethodGeneration"/>
    <!-- The PMD mistakes the AbstractViolationReporter::log() as a debug log. -->
    <exclude name="GuardLogStatement"/>
  </rule>
  <rule ref="category/java/bestpractices.xml/AvoidPrintStackTrace">
    <properties>
      <!-- It is ok to use print stack trace in CLI class. -->
      <property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[@Image='Main']"/>
    </properties>
  </rule>
  <rule ref="category/java/bestpractices.xml/JUnitAssertionsShouldIncludeMessage">
    <properties>
      <!-- The PMD check accepts only a string constant as the assert message.
           This check uses a method call. -->
      <property name="violationSuppressXPath"
                value="//ClassOrInterfaceDeclaration[@Image='JavadocCatchCheck']
                           //MethodDeclaration[@Name='visitJavadocToken']"/>
    </properties>
  </rule>
  <rule ref="category/java/bestpractices.xml/SystemPrintln">
    <properties>
      <!-- it is ok to use println in CLI class. -->
      <property name="violationSuppressXPath"
                value="//ClassOrInterfaceDeclaration
                       [@Image='Main' or @Image='Main$CliOptions'
                       or @Image='JavadocPropertiesGenerator']"/>
    </properties>
  </rule>

  <rule ref="category/java/documentation.xml">
    <!-- We use class comments as source for xdoc files,
         so content is big and that is by design. -->
    <exclude name="CommentSize"/>
  </rule>
  <rule ref="category/java/documentation.xml/CommentRequired">
    <properties>
      <!-- *TokenTypes are special class, comments are as trailing comments.
           RequireThisCheck$AbstractFrame is a private class, no comment is required.
           Main.runCli has a false positive for an anonymous class.
      -->
      <property name="violationSuppressXPath"
                value="//ClassOrInterfaceDeclaration[@Image='JavadocTokenTypes']
      | //ClassOrInterfaceDeclaration[@Image='RequireThisCheck']
      | //ClassOrInterfaceDeclaration[@Image='AbstractFrame']
      | //ClassOrInterfaceDeclaration[@Image='Main']//MethodDeclaration[@Name='runCli']"/>
    </properties>
  </rule>

  <rule ref="category/java/codestyle.xml">
    <!-- Opposite to UnnecessaryConstructor. -->
    <exclude name="AtLeastOneConstructor"/>
    <!-- Turning a local variable to the field may create design problems and extend the scope of
           the variable. -->
    <exclude name="AvoidFinalLocalVariable"/>
    <!-- Conflicts with names that does not mean in/out. -->
    <exclude name="AvoidPrefixingMethodParameters"/>
    <!-- Calling super() is completely pointless, no matter if class inherits anything or not;
         it is meaningful only if you do not call implicit constructor of the base class. -->
    <exclude name="CallSuperInConstructor"/>
    <!-- Pollutes code with modifiers. -->
    <exclude name="LocalVariableCouldBeFinal"/>
    <!-- Pollutes the code with modifiers. We use the ParameterAssignmentCheck to protect the
         parameters. -->
    <exclude name="MethodArgumentCouldBeFinal"/>
    <!-- It is possible only in functional languages and fanatically-pristine code, without
         additional option that are done at ReturnCountExtendedCheck it is not a good rule. -->
    <exclude name="OnlyOneReturn"/>
    <!-- We use CheckstyleCustomShortVariable, to control the length and skip Override methods. -->
    <exclude name="ShortVariable"/>
  </rule>
  <rule ref="category/java/codestyle.xml/ClassNamingConventions">
    <properties>
     <property name="classPattern" value="[A-Z][a-zA-Z0-9]*" />
     <property name="abstractClassPattern" value="Abstract[A-Z][a-zA-Z0-9]*" />
     <property name="interfacePattern" value="[A-Z][a-zA-Z0-9]*" />
     <property name="enumPattern" value="[A-Z][a-zA-Z0-9]*" />
     <property name="annotationPattern" value="[A-Z][a-zA-Z0-9]*" />
     <property name="utilityClassPattern" value="[A-Z][a-zA-Z0-9]*Util" />
     <!-- We can not brake compatibility with previous versions. -->
     <property name="violationSuppressXPath"
               value="//ClassOrInterfaceDeclaration
                          [@Image='AbstractClassNameCheck' or @Image='AutomaticBean']"/>
    </properties>
  </rule>
  <rule ref="category/java/codestyle.xml/ClassNamingConventions">
    <properties>
     <!-- Definitions and XmlLoader.LoadExternalDtdFeatureProvider aren't utility classes.
          JavadocTokenTypes and TokenTypes aren't utility classes.
            They are token definition classes. Also, they are part of the API. -->
     <property name="violationSuppressXPath"
               value="//ClassOrInterfaceDeclaration[@Image='Definitions'
                   or @Image='JavadocTokenTypes' or @Image='TokenTypes'
                   or @Image='LoadExternalDtdFeatureProvider']"/>
    </properties>
  </rule>
  <rule ref="category/java/codestyle.xml/ConfusingTernary">
    <properties>
      <!-- False positives on IF_ELSE-IF-ELSE-IF. -->
      <property name="violationSuppressXPath"
                value="//ClassOrInterfaceDeclaration[@Image='XMLLogger']
                           //MethodDeclarator[@Image='isReference']
      | //ClassOrInterfaceDeclaration[@Image='DetailAST']
              //MethodDeclarator[@Image='addPreviousSibling']
      | //ClassOrInterfaceDeclaration[@Image='AnnotationLocationCheck']
              //MethodDeclarator[@Image='checkAnnotations']
      | //ClassOrInterfaceDeclaration[@Image='AbstractImportControl']
              //MethodDeclarator[@Image='checkAccess']
      | //ClassOrInterfaceDeclaration[@Image='HandlerFactory']
              //MethodDeclarator[@Image='getHandler']"/>
    </properties>
  </rule>
  <rule ref="category/java/codestyle.xml/EmptyMethodInAbstractClassShouldBeAbstract">
    <properties>
      <!-- Can not change the API. -->
      <property name="violationSuppressXPath"
                value="//ClassOrInterfaceDeclaration[@Image='AbstractFileSetCheck'
        or @Image='AbstractCheck' or @Image='AbstractJavadocCheck' or @Image='AbstractNode'
        or @Image='AbstractViolationReporter']"/>
    </properties>
  </rule>
  <rule ref="category/java/codestyle.xml/UseUnderscoresInNumericLiterals">
    <properties>
      <!-- Numbers up to 6 digits are easy to read without underscores. -->
      <property name="acceptableDecimalLength" value="6"/>
    </properties>
  </rule>
  <rule ref="category/java/codestyle.xml/LongVariable">
    <properties>
      <!-- Nothing bad with the long and descriptive variable names if only they fit the line,
           but still keep it reasonable. -->
      <property name="minimum" value="45"/>
    </properties>
  </rule>
  <rule ref="category/java/codestyle.xml/ShortClassName">
    <properties>
      <!-- Main is a good name for the class containing the main method.
           Tag as inner class name is fine. -->
      <property name="violationSuppressXPath"
                value="//ClassOrInterfaceDeclaration[@Image='Main' or @Image='Tag']"/>
    </properties>
  </rule>
{'fraction_non_alphanumeric': 0.12971469237238792, 'fraction_numerical': 0.0045286925017791295, 'mean_word_length': 3.0689655172413794, 'pattern_counts': {'":': 0, '<': 207, '<?xml version=': 2, '>': 207, 'https://': 1, 'lorem ipsum': 0, 'www.': 2, 'xml': 33}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5165829', 'n_tokens_mistral': 4215, 'n_tokens_neox': 4096, 'n_words': 1021}