> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codeant.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Xml

<AccordionGroup>
  <Accordion title="targetNamespaces should comply with a naming convention">
    <div class="paragraph">
      <p>Sharing naming conventions allows teams to collaborate efficiently. This rule checks that targetNamespaces match a provided regular expression.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
             elementFormDefault="qualified" version="1"
              targetNamespace="fruit">  <!-- Noncompliant -->
      ...
      ```

      ```xml Fix theme={null}
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
             elementFormDefault="qualified" version="1"
             targetNamespace="http://www.codeSamples.com/fruit">
      ...
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Schemas should have descriptions">
    <div class="paragraph">
      <p>Having robust documentation just makes life easier. That applies to XSD’s as well. Each one should include a description of its intended use, and perhaps versioning.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when there’s neither a comment before the <code>\<xs:schema> tag, nor \<xsd:annotation>\<xsd:documentation>...\</xsd:documentation>\</xsd:annotation> just inside the \<xs:schema></code> element.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <xs:schema targetNamespace="http://www.codeSamples.com/fruit"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             elementFormDefault="qualified" version="1">
      <xs:element name="fruit">
      ...
      </xs:element>
      </xs:schema>
      ```

      ```xml Fix theme={null}
      <-- This schema is intended... -->
      <xs:schema targetNamespace="http://www.codeSamples.com/fruit"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             elementFormDefault="qualified" version="1">
      <xs:element name="fruit">
      ...
      </xs:element>
      </xs:schema>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Attributes should comply with a naming convention">
    <div class="paragraph">
      <p>Shared naming conventions allow teams to collaborate efficiently. This rule checks that all attribute names match a provided regular expression.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <xs:element name="fruit">
      ...
      <xs:attribute name="FLESH_COLOR" type="xs:string">     <!-- Noncompliant -->
      </xs:element>
      ```

      ```xml Fix theme={null}
      <xs:element name="fruit">
      ...
      <xs:attribute name="fleshColor" type="xs:string">
      </xs:element>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Default EJB interceptors should be declared in ejb-jar.xml">
    <div class="paragraph">
      <p>EJB interceptors provide a way to define code that can be executed before and
      after a method call. They are typically used for logging, testing, auditing or
      security purposes.</p>
    </div>

    <div class="paragraph">
      <p>Interceptor methods can be applied or bound at three levels:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>The default interceptor is called for each bean as part of the deployment and
          can only be applied through an XML file.</p>
        </li>

        <li>
          <p>The class-level interceptor is invoked for each method of the bean. The
          class-level interceptor can be applied both through an annotation and through
          an XML file.</p>
        </li>

        <li>
          <p>The method-level interceptor is invoked for a specific method of the bean.
          The method-level interceptor can be applied both through an annotation and
          through an XML file.</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>If you want to declare these methods in an XML file, you must declare them in a
      file named ejb-jar.xml. Otherwise, they may not be applied or used as
      intended.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <!-- ejb-interceptors.xml -->

      <assembly-descriptor>
      <interceptor-binding>
        <ejb-name>*</ejb-name>
        <interceptor-class>com.myco.ImportantInterceptor</interceptor-class> <!-- Noncompliant -->
      </interceptor-binding>
      </assembly-descriptor>
      ```

      ```xml Fix theme={null}
      <!-- ejb-jar.xml -->

      <assembly-descriptor>
      <interceptor-binding>
          <ejb-name>*</ejb-name>
          <interceptor-class>com.myco.ImportantInterceptor</interceptor-class>
      </interceptor-binding>
      </assembly-descriptor>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Struts filters should not miss their corresponding filter-map">
    <div class="paragraph">
      <p>Filters are used to intercept requests and responses from a server and allow
      developers to manipulate them. When a filter is declared, but the
      corresponding filter assignment is inadvertently not, then the code is
      vulnerable to security problems or business logic instability.</p>
    </div>

    <div class="paragraph">
      <p>If a filter is defined in the web application descriptor file web.xml but is
      not used in a "filter mapping", this is an indication that it may have been
      forgotten.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <filter>
      <filter-name>ValidationFilter</filter-name> <!-- Noncompliant -->
      <filter-class>com.myco.servlet.ValidationFilter</filter-class>
      </filter>
      ```

      ```xml Fix theme={null}
      <filter>
      <filter-name>ValidationFilter</filter-name>
      <filter-class>com.myco.servlet.ValidationFilter</filter-class>
      </filter>

      <filter-mapping>
      <filter-name>ValidationFilter</filter-name>
      <url-pattern>/*</url-pattern>
      </filter-mapping>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Delivering code in production with debug features activated is security-sensitive">
    <div class="paragraph">
      <p>rameworks usually have options to make debugging easier for developers. Although these features are useful during development, they should never be enabled for applications deployed in production.</p>
    </div>

    <div class="paragraph">
      <p>Activating a development feature in production can have an important range of consequences depending on its use:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>Technical information leak; generally by disclosing verbose logging information to the application’s user.</p>
        </li>

        <li>
          <p>Arbitrary code execution; generally with a parameter that will allow the remote debugging or profiling of the application.</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>In all cases, the attack surface of an affected application is increased. In some cases, such features can also make the exploitation of other unrelated vulnerabilities easier.</p>
    </div>

    <CodeGroup>
      ```xml Bad theme={null}
      <application
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:supportsRtl="true"
      android:debuggable="true"
      android:theme="@style/AppTheme">
      </application>  <!-- Sensitive -->
      ```

      ```xml Fix theme={null}
      <configuration>
      <system.web>
      <customErrors mode="Off" /> <!-- Sensitive -->
      </system.web>
      </configuration>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="nillable should not be used">
    <div class="paragraph">
      <p>Having a \`nillable element in a schema means that element must always be present, whether or not you have data for it. That means that the resulting XML transmissions will be larger than they need to be. On the other hand, minOccurs="0" communicates the same "there is no value" message, with smaller XML messages. For that reason, minOccurs="0" is <em>almost</em> always preferred over nillable="true". The one case were nillable="true" is valuable is in the case of an array element, where you may have the need to set a placeholder.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when nillable="true" is used on an element were maxOccurs\` is 1.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <complexType name="fruitArray" nillable="true">            <!-- Noncompliant -->
      <sequence>
      <element name="fruit" type="xs:string" nillable="true" maxOccurs="4"/>    <!-- ignored -->
      </sequence>
      </complexType>
      ```

      ```xml Fix theme={null}
      <complexType name="fruitArray">
      <sequence>
      <element name="fruit" type="xs:string" minOccurs="0" maxOccurs="4"/>
      </sequence>
      </complexType>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Struts validation forms should have unique names">
    <div class="paragraph">
      <p>In Struts, form validation is used to validate the data the application’s
      clients provide as part of a form submission to the server. Configuring two
      different form validations with the same name leads to unexpected behaviors.</p>
    </div>

    <div class="paragraph">
      <p>When faced with multiple form validations with the same name, Struts will
      arbitrarily choose one and apply it while discarding the others.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <form-validation>
      <formset>
      <form name="BookForm"> ... </form>
      <form name="BookForm"> ... </form>  <!-- Noncompliant -->
      </formset>
      </form-validation>
      ```

      ```xml Fix theme={null}
      <form-validation>
      <formset>
      <form name="BookForm"> ... </form>
      </formset>
      </form-validation>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="lax processing should only be used when no namespace is provided">
    <div class="paragraph">
      <p>\`xs:any and xs:anyAttribute are wildcards; they allow the XML document author to use any element or attribute. By specifying nameSpaces for them, you can restrict what’s used to elements in the specified name spaces. By default, what’s used for xs:any and xs:anyAttribute will be validated in a strict manner (processContents="strict"). That is, validation will fail if the element used isn’t recognized. That makes sense if you’ve provided a namespace, but not if you haven’t. Conversely, processContents="lax" allows unrecognized elements to pass validation even if they’re not recognized. That makes sense if no namespace has been specified, but not if one has been specified.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when strict processing is used (either explicitly or implicitly) when no namespace is provided, and conversely when lax\` processing is used with a namespace.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      ToDo
      ```

      ```xml Fix theme={null}
      ToDo
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Standard namespace prefixes should not be used for unexpected namespaces">
    <div class="paragraph">
      <p>Certain prefixes are widely recognized and expected to correspond to specific namespaces. For instance, most users will expect "xs" to correspond to "[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)". If you subvert that expected correspondence, you run the risk of severely confusing the users of your XSD.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <xs:schema targetNamespace="http://www.codeSamples.com/fruit"
             elementFormDefault="qualified" version="1"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             xmlns:wsdl="http://CodeSamples.com/animal>       <!-- Noncompliant -->
      ...
      ```

      ```xml Fix theme={null}
      <xs:schema targetNamespace="http://www.codeSamples.com/fruit"
             elementFormDefault="qualified" version="1"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             xmlns:animal="http://CodeSamples.com/animal>
      ...
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Schemas should have targetNamespaces">
    <div class="paragraph">
      <p>The use of a <code>targetNamespace</code> in an XSD means that all the elements described in the XSD are restricted to that namespace, rather than landing in the global namespace. This provides clarity, and makes the schema easier to use in concert with other schemas that might define elements with the same names.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
             elementFormDefault="qualified" version="1">  <!-- Noncompliant -->
      ...
      ```

      ```xml Fix theme={null}
      <xs:schema targetNamespace="http://www.codeSamples.com/fruit"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             elementFormDefault="qualified" version="1">
      ...
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="ID and IDREF should not be used">
    <div class="paragraph">
      <p>\`ID and IDREF are constructs inherited from DTDs, and they suffer from painful drawbacks, mainly:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>IDs are too widely scoped: an ID must be unique in the XML document. This means that if an XML document contains \<Person> elements and \<Dog> elements, both with a "name" attribute of type="xs:ID", then two people can’t have the same name. Neither can two dogs, or a person and a dog.</p>
        </li>

        <li>
          <p>IDs must comply with tight naming scheme. For example, "123" is not a valid value for an ID.</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>Instead, KEY and KEYREF should be used. And if you really need to insure uniqueness, use xs:unique\` to add a uniqueness constraint.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      ToDo
      ```

      ```xml Fix theme={null}
      ToDo
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="DefaultMessageListenerContainer instances should not drop messages during restarts">
    <div class="paragraph">
      <p>\`DefaultMessageListenerContainer is implemented as a JMS poller. While the Spring container is shutting itself down, as each in-progress JMS Consumer.receive() call completes, any non-null return value will be a JMS message that the DMLC will <em>discard</em> due to the shutdown in progress. That will result in the received message never being processed.</p>
    </div>

    <div class="paragraph">
      <p>To prevent message loss during restart operations, set acceptMessagesWhileStopping to true\` so that such messages will be processed before shut down.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <bean id="listenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">  <!-- Noncompliant -->
      <property name="connectionFactory" ref="connFactory" />
      <property name="destination" ref="dest" />
      <property name="messageListener" ref="serviceAdapter" />
      <property name="autoStartup" value="true" />
      <property name="concurrentConsumers" value="10" />
      <property name="maxConcurrentConsumers" value="10" />
      <property name="clientId" value="myClientID" />
      </bean>
      ```

      ```xml Fix theme={null}
      <bean id="listenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
      <property name="connectionFactory" ref="connFactory" />
      <property name="destination" ref="dest" />
      <property name="messageListener" ref="serviceAdapter" />
      <property name="autoStartup" value="true" />
      <property name="concurrentConsumers" value="10" />
      <property name="maxConcurrentConsumers" value="10" />
      <property name="clientId" value="myClientID" />
      <property name="acceptMessagesWhileStopping" value="true" />
      </bean>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Allowing application backups is security-sensitive">
    <div class="paragraph">
      <p>backup mechanism that can save and restore application
      data. When application backup is enabled, local data from your application can
      be exported to Google Cloud or to an external device via <code>adb backup</code>.
      Enabling Android backup exposes your application to disclosure of sensitive
      data. It can also lead to corruption of local data when restoration is performed
      from an untrusted source.</p>
    </div>

    <div class="paragraph">
      <p>By default application backup is enabled and it includes:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>Shared preferences files</p>
        </li>

        <li>
          <p>Files saved in one of the paths returned by</p>

          <div class="ulist">
            <ul>
              <li>
                <p><a href="https://developer.android.com/reference/android/content/Context#getDatabasePath(java.lang.String)">getDatabasePath(String)</a></p>
              </li>

              <li>
                <p><a href="https://developer.android.com/reference/android/content/Context#getFilesDir()">getFilesDir()</a></p>
              </li>

              <li>
                <p><a href="https://developer.android.com/reference/android/content/Context#getDir(java.lang.String,%20int)">getDir(String, int)</a></p>
              </li>

              <li>
                <p><a href="https://developer.android.com/reference/android/content/Context#getExternalFilesDir(java.lang.String)">getExternalFilesDir(String)</a></p>
              </li>
            </ul>
          </div>
        </li>
      </ul>
    </div>

    <CodeGroup>
      ```xml Bad theme={null}
      <application
      android:allowBackup="true"> <!-- Sensitive -->
      </application>
      ```

      ```xml Fix theme={null}
      <application
      android:allowBackup="false">
      </application>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Unused prefixes should be removed">
    <div class="paragraph">
      <p>Namespace prefixes that are declared but not used simply clutter the document and confuse maintainers. Such prefixes should be removed.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <xs:schema targetNamespace="http://www.codeSamples.com/fruit"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             xmlns:animal="http://www.codeSamples.com/animal"
             elementFormDefault="qualified" version="1">  <!-- Noncompliant -->
      <xs:element name="fruit">
      <xs:complexType>
        <xs:sequence>
          ...                        <!-- assume that no use of prefix "animal" is made here -->
        </xs:sequence>
      </xs:complexType>
      </xs:element>
      </xs:schema>
      ```

      ```xml Fix theme={null}
      <xs:schema targetNamespace="http://www.codeSamples.com/fruit"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             elementFormDefault="qualified" version="1">
      <xs:element name="fruit">
      <xs:complexType>
        <xs:sequence>
          ...                        <!-- assume that no use of prefix "animal" is made here -->
        </xs:sequence>
      </xs:complexType>
      </xs:element>
      </xs:schema>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Requesting dangerous Android permissions is security-sensitive">
    <div class="paragraph">
      <p>ve a large impact on user privacy, marked as <a href="https://developer.android.com/reference/android/Manifest.permission">dangerous or "not for use by third-party applications" by Android</a>, should be requested only if they are really necessary to implement critical features of an application.</p>
    </div>

    <CodeGroup>
      ```xml Bad theme={null}
      <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- Compliant -->
      ```

      ```xml Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Hibernate should not update database schemas">
    <div class="paragraph">
      <p>The use of any value but <code>"validate" for hibernate.hbm2ddl.auto may cause the database schema used by your application to be changed, dropped, or cleaned of all data. In short, the use of this property is risky, and should only be used in production with the "validate"</code> option, if it is used at all.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <session-factory>
      <property name="hibernate.hbm2ddl.auto">update</property>  <!-- Noncompliant -->
      </session-factory>
      ```

      ```xml Fix theme={null}
      <session-factory>
      <property name="hibernate.hbm2ddl.auto">validate</property>  <!-- Compliant -->
      </session-factory>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Dependencies should not have system scope">
    <div class="paragraph">
      <p><code>system</code> dependencies are sought at a specific, specified path. This drastically reduces portability because if you deploy your artifact in an environment that’s not configured just like yours is, your code won’t work.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <dependency>
      <groupId>javax.sql</groupId>
      <artifactId>jdbc-stdext</artifactId>
      <version>2.0</version>
      <scope>system</scope>  <!-- Noncompliant -->
      <systemPath>/usr/bin/lib/rt.jar</systemPath>  <!-- remove this -->
      </dependency>
      ```

      ```xml Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="elementFormDefault should be qualified">
    <div class="paragraph">
      <p>It can be tempting to set \`elementFormDefault to unqualified, because it allows XML document authors to remove a few prefixes in their files. However this is not a good practice for several reasons:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>The unqualified form doesn’t convey any functionality.</p>
        </li>

        <li>
          <p>Most XML schemas are qualified, so defining a few unqualified schemas requires the author of an XML document to fully master both cases with no added value.</p>
        </li>

        <li>
          <p>The unqualified form implies that in the XML document, all global elements from the schema must be qualified, and all local elements must be unqualified. So the author must be very cautious regarding the local vs. global nature of each element.</p>
        </li>

        <li>
          <p>The unqualified form implies that in an XML document, the default namespace cannot be used. This stems from the fact that a document’s default namespace qualifies all prefix-less elements, and an element cannot be both qualified and unqualified. For the XML document author, being prevented from using the default namespace is a real nuisance.</p>
        </li>

        <li>
          <p>In some cases, the unqualified form degrades performance, by requiring the processing tool to look up the unqualified\` elements in the schema file.</p>
        </li>
      </ul>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <xs:schema targetNamespace="http://www.codeSamples.com/fruit"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             version="1">                                 <!-- Noncompliant -->
      ...
      ```

      ```xml Fix theme={null}
      <xs:schema targetNamespace="http://www.codeSamples.com/fruit"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             elementFormDefault="qualified" version="1">
      ...
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Deprecated ${pom} properties should not be used">
    <div class="paragraph">
      <p>Deprecated features are those that have been retained temporarily for backward compatibility, but which will eventually be removed. In effect, deprecation announces a grace period to allow the smooth transition from the old features to the new ones. In that period, no use of the deprecated features should be added, and all existing uses should be gradually removed.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when <code>\$\{pom.\*}</code> properties are used in a pom.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <build>
      <finalName>${pom.artifactId}-${pom.version}</finalName>  <!-- Noncompliant -->
      ```

      ```xml Fix theme={null}
      <build>
      <finalName>${project.artifactId}-${project.version}</finalName>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Track uses of disallowed dependencies">
    <div class="paragraph">
      <p>Whether they are disallowed locally for security, license, or dependability reasons, forbidden dependencies should not be used.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when the group or artifact id of a direct dependency matches the configured forbidden dependency pattern.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <dependency> <!-- Noncompliant --> 
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId> 
      <version>1.2.17</version> 
      </dependency>
      ```

      ```xml Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="EJB interceptor exclusions should be declared as annotations">
    <div class="paragraph">
      <p>Exclusions for default interceptors can be declared either in xml or as class annotations. Since annotations are more visible to maintainers, they are preferred.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <assembly-descriptor>
        <interceptor-binding>
           <ejb-name>MyExcludedClass</ejb-name>
           <exclude-default-interceptors>true</exclude-default-interceptors> <!-- Noncompliant -->
           <exclude-class-interceptors>true</exclude-class-interceptors> <!-- Noncomopliant -->
           <method>
             <method-name>doTheThing</method-name>
           </method>
        </interceptor-binding>

      </assembly-descriptor>
      ```

      ```xml Fix theme={null}
      @ExcludeDefaultInterceptors
      public class MyExcludedClass implements MessageListener
      {

      @ExcludeClassInterceptors
      @ExcludeDefaultInterceptors
      public void doTheThing() {
      // ...
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="all should not be used">
    <div class="paragraph">
      <p>The <code>\<xs:all> group element isn’t supported universally among web service stacks. That means that if you use it, you may end up failing to transmit your data (in the resulting XML files) to systems that can’t process it. For that reason, \<xs:sequence> should be used instead. The only constraint imposed by the use of an \<xs:sequence></code> is the order it imposes, but that is usually a benefit for human readers.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <xs:complexType name="fruitType">
      <xs:all>  <!-- Noncompliant -->
      <xs:element name="name" type="xs:string"/>
      <xs:element name="color" type="xs:string"/>
      </xs:all>
      </xs:complexType>
      ```

      ```xml Fix theme={null}
      <xs:complexType name="fruitType">
      <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      <xs:element name="color" type="xs:string"/>
      </xs:sequence>
      </xs:complexType>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="SingleConnectionFactory instances should be set to reconnectOnException">
    <div class="paragraph">
      <p>Use of a Spring \`SingleConnectionFactory without enabling the reconnectOnException setting will prevent automatic connection recovery when the connection goes bad.</p>
    </div>

    <div class="paragraph">
      <p>That’s because the reconnectOnException property defaults to false. As a result, even if the code that uses this connection factory (Spring’s DefaultMessageListenerContainer or your own code) has reconnect logic, that code won’t work because the SingleConnectionFactory will act like a single-connection pool by preventing connection close calls from actually closing anything. As a result, subsequent factory create operations will just hand back the original broken Connection\`.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <bean id="singleCF" class="org.springframework.jms.connection.SingleConnectionFactory">  <!-- Noncompliant -->
      <constructor-arg ref="dummyConnectionFactory" />
      </bean>
      ```

      ```xml Fix theme={null}
      <bean id="singleCF" class="org.springframework.jms.connection.SingleConnectionFactory" p:reconnectOnException="true">
      <constructor-arg ref="dummyConnectionFactory" />
      </bean>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="action mappings should not have too many forward entries">
    <div class="paragraph">
      <p>It makes sense to handle all related actions in the same place. Thus, the same \`\<action> might logically handle all facets of CRUD on an entity, with no confusion in the naming about which \<forward/> handles which facet. But go very far beyond that, and it becomes difficult to maintain a transparent naming convention.</p>
    </div>

    <div class="paragraph">
      <p>So to ease maintenance, this rule raises an issue when an \<action> has more than the allowed number of \<forward/>\` tags.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <action path='/book' type='myapp.BookDispatchAction' name='form' parameter='method'>
      <forward name='create' path='/WEB-INF/jsp/BookCreate.jspx' redirect='false'/>
      <forward name='read' path='/WEB-INF/jsp/BookDetails' redirect='false'/>
      <forward name='update' path='/WEB-INF/jsp/BookUpdate.jspx' redirect='false'/>
      <forward name='delete' path='/WEB-INF/jsp/BookDelete.jspx' redirect='false'/>
      <forward name='authorRead' path='WEB-INF/jsp/AuthorDetails' redirect='false'/>  <!-- Noncompliant -->
      </action>
      ```

      ```xml Fix theme={null}
      <action path='/book' type='myapp.BookDispatchAction' name='bookForm' parameter='method'>
      <forward name='create' path='/WEB-INF/jsp/BookCreate.jspx' redirect='false'/>
      <forward name='read' path='/WEB-INF/jsp/BookDetails' redirect='false'/>
      <forward name='update' path='/WEB-INF/jsp/BookUpdate.jspx' redirect='false'/>
      <forward name='delete' path='/WEB-INF/jsp/BookDelete.jspx' redirect='false'/>
      </action>

      <action path='/author' type='myapp.AuthorDispatchAction' name='authorForm' parameter='method'>
      <forward name='authorRead' path='WEB-INF/jsp/AuthorDetails' redirect='false'/>
      </action>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Defining a single permission for read and write access of content providers is security-sensitive">
    <div class="paragraph">
      <p>+<code> is used to set a single permission for both reading and writing data from a content provider.
      In regard to the Principle of Least Privilege, client applications that consume the content provider should only have the necessary privileges to complete their tasks. As android:permission</code> grants both read and write access, it prevents client applications from applying this principle.
      In practice, it means client applications that require read-only access will have to ask for more privileges than what they need: the content provider will always grant read and write together.</p>
    </div>

    <CodeGroup>
      ```xml Bad theme={null}
      <provider 
      android:authorities="com.example.app.Provider"
      android:name="com.example.app.Provider"
      android:permission="com.example.app.PERMISSION"  <!-- Sensitive -->
      android:exported="true"/>
      ```

      ```xml Fix theme={null}
      <provider
      android:authorities="com.example.app.Provider"
      android:name="com.example.app.Provider"
      android:readPermission="com.example.app.PERMISSION"  <!-- Sensitive -->
      android:writePermission="com.example.app.PERMISSION" <!-- Sensitive -->
      android:exported="true"/>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Artifact ids should follow a naming convention">
    <div class="paragraph">
      <p>Shared naming conventions allow teams to collaborate effectively. This rule raises an issue when a pom’s <code>artifactId</code> does not match the provided regular expression.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <project ...>
      <artifactId>My_Project</artifactId>  <!-- Noncompliant -->

      <!-- ... -->
      </project>
      ```

      ```xml Fix theme={null}
      <project ...>
      <artifactId>my-project</artifactId>

      <!-- ... -->
      </project>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Schemas should be versioned">
    <div class="paragraph">
      <p>Schema versioning is a big topic, with best practices rather than hard-and-fast rules. One of these best practices is to include the <code>version attribute in the xsd:schema</code> and increment it to indicate minor changes. Nothing breaks if the value changes, but it does give the user a relatively prominent indication that something has changed.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <xs:schema targetNamespace="http://www.codeSamples.com/fruit"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             elementFormDefault="qualified">  <!-- Noncompliant -->
      ...
      ```

      ```xml Fix theme={null}
      <xs:schema targetNamespace="http://www.codeSamples.com/fruit"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             elementFormDefault="qualified" version="1">
      ...
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Components should have explicit data types">
    <div class="paragraph">
      <p>Omitting the data type of an attribute or element leaves it to default to <code>xs:any for elements, and xs:anyType</code> for attributes. However there is no reason for making such a significant design decision implicit..</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <xs:element name="fruit">
      <xs:complexType>
      <xs:sequence>
        <xs:element name="color"/> <!-- Noncompliant -->
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      ```

      ```xml Fix theme={null}
      <xs:element name="fruit">
      <xs:complexType>
      <xs:sequence>
        <xs:element name="color" type="xs:string"/>
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="XML files containing a prolog header should start with <?xml characters">
    <div class="paragraph">
      <p>The prolog header is the following piece of code that some XML documents start with:</p>
    </div>

    <div class="listingblock">
      <div class="content">
        <pre>\<?xml version="y.x" encoding="zzzzz"?></pre>
      </div>
    </div>

    <div class="paragraph">
      <p>When the prolog exists in an XML document, it should be at the beginning of the file to enable programs to determine the encoding of non-UTF-8, non-UTF-16 files.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <!-- Generated file -->  <!--  Noncompliant  -->
      <?xml version="1.0" encoding="UTF-8"?>
      <firstNode>
      content
      </firstNode>
      ```

      ```xml Fix theme={null}
      <?xml version="1.0" encoding="UTF-8"?>
      <!-- Generated file -->
      <firstNode>
      content
      </firstNode>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Complex types should not be restricted">
    <div class="paragraph">
      <p>Complex types can be restricted by means of an \`xs:restriction element. But restriction is anti-inheritance: the derived type has less information than the base type. Further, restriction causes the redefinition of the complex types elements and attributes, which leads to fragility in your XML schema; any change to a super type will require corresponding changes in all restricting subtypes, even those in other schemas. For example, if the base type defines a mandatory "color" element of type xs:int, the restricting type must also define a "color" element whose type cannot be, say, xs:string.</p>
    </div>

    <div class="paragraph">
      <p>xs:extension\`, on the other hand, allows the extending element to inherit the base class' elements and add new ones.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <xs:complexType name="Fruit>
      <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      <xs:element name="color" type="xs:string" minOccurs="0"/>
      </xs:sequence>
      </xs:complexType>
      <xs:complexType name="UncoloredFruit">
      <xs:complexContent>
      <xs:restriction base="Fruit">  <!-- Noncompliant -->
        <xs:sequence>
          <xs:element name="name" type="xs:string"/>
        </xs:sequence>
      </xs:restriction>
      </xs:complexContent>
      </xs:complexType>
      ```

      ```xml Fix theme={null}
      <xs:complexType name="FruitBase>
      <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      </xs:sequence>
      </xs:complexType>
      <xs:complexType name="ColoredFruit>
      <xs:sequence>
      <!-- Bottom-up design, using aggregation -->
      <xs:element name="base" type="FruitBase"/>
      <xs:element name="color" type="xs:string" minOccurs="0"/>
      </xs:sequence>
      </xs:complexType>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Element names should comply with a naming convention">
    <div class="paragraph">
      <p>Shared naming conventions allow teams to collaborate efficiently. This rule checks that all element names match a provided regular expression.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <xs:element name="Fruit">     <!-- Noncompliant -->
      ...
      </xs:element>
      ```

      ```xml Fix theme={null}
      <xs:element name="fruit">
      ...
      </xs:element>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Type names should comply with a naming convention">
    <div class="paragraph">
      <p>Sharing naming conventions allows teams to collaborate efficiently. This rule checks that type names match a provided regular expression.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <xs:complexType name="fruit">    <!-- Noncompliant -->
      ...
      </xs:complexType>
      ```

      ```xml Fix theme={null}
      <xs:complexType name="fruitType">
      ...
      </xs:complexType>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Group ids should follow a naming convention">
    <div class="paragraph">
      <p>Shared naming conventions allow teams to collaborate effectively. This rule raises an issue when the a pom’s <code>groupId</code> does not match the provided regular expression.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <project ...>
      <groupId>myCo</groupId>  <!-- Noncompliant -->

      <!-- ... -->
      </project>
      ```

      ```xml Fix theme={null}
      <project ...>
      <groupId>com.myco</groupId>

      <!-- ... -->
      </project>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Exported component access should be restricted with appropriate permissions">
    <div class="paragraph">
      <p>Once an Android component has been exported, it can be used by attackers to
      launch malicious actions and might also give access to other components
      that are not exported. For this reason, the following components should be protected:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>Providers</p>
        </li>

        <li>
          <p>Activities</p>
        </li>

        <li>
          <p>Activity-aliases</p>
        </li>

        <li>
          <p>Services</p>
        </li>
      </ul>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <provider
      android:authorities="com.example.app.Provider"
      android:name="com.example.app.Provider"
      android:exported="true" />  <!-- Noncompliant -->
      ```

      ```xml Fix theme={null}
      <provider
      android:authorities="com.example.app.Provider"
      android:name="com.example.app.Provider"
      android:exported="true"
      android:writePermission="com.example.app.WRITE_PERMISSION" />  <!-- Noncompliant -->
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Multiple prefixes should not be used for a single namespace">
    <div class="paragraph">
      <p>Having multiple prefixes for the same namespace is highly likely to confuse users and maintainers of the schema.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <xs:schema targetNamespace="http://www.codeSamples.com/fruit"
             elementFormDefault="qualified" version="1"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             xmlns:animal="http://www.codeSamples.com/animal"
             xmlns:beast="http://www.codeSamples.com/animal">    <!-- Noncompliant -->
      ...
      </xs:schema>
      ```

      ```xml Fix theme={null}
      <xs:schema targetNamespace="http://www.codeSamples.com/fruit"
             elementFormDefault="qualified" version="1"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             xmlns:animal="http://www.codeSamples.com/animal">
      ...
      </xs:schema>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Custom permissions should not be defined in the android.permission namespace">
    <div class="paragraph">
      <p>Namespaces act as a container for grouping together permissions with a common theme or purpose. They also prevent conflicts when multiple apps want to use the same permission name.</p>
    </div>

    <div class="paragraph">
      <p>The \`android.permission namespace holds all of the permissions defined by the Android operating system. It is not intended to be a general use container for all permissions.</p>
    </div>

    <div class="paragraph">
      <p>Defining permissions in the android.permission\` namespace increases the risk of a permission name collision. The collision could be due to a new Android system permission, or it could be due to another app using the same permission name.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```xml Bad theme={null}
      <?xml version="1.0" encoding="utf-8"?>
      <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.organization.app">

      <permission
          android:name="android.permission.MY_PERMISSION" /> <!-- Noncompliant -->

      </manifest>
      ```

      ```xml Fix theme={null}
      <?xml version="1.0" encoding="utf-8"?>
      <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.organization.app">

      <permission
          android:name="com.organization.app.permission.MY_PERMISSION" />

      </manifest>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Having a permissive Cross-Origin Resource Sharing policy is security-sensitive">
    <div class="paragraph">
      <p>Having a permissive Cross-Origin Resource Sharing policy is security-sensitive. It has led in the past to the following vulnerabilities:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p><a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0269">CVE-2018-0269</a></p>
        </li>

        <li>
          <p><a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14460">CVE-2017-14460</a></p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p><a href="https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy">Same origin policy</a> in browsers prevents, by default and for security-reasons, a javascript frontend to perform a cross-origin HTTP request to a resource that has a different origin (domain, protocol, or port) from its own. The requested target can append additional HTTP headers in response, called <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS">CORS</a>, that act like directives for the browser and change the access control policy / relax the same origin policy.</p>
    </div>

    <CodeGroup>
      ```xml Bad theme={null}
      <!-- Tomcat 7+ Cors Filter -->
      <filter>
      <filter-name>CorsFilter</filter-name>
      <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
      <init-param>
      <param-name>cors.allowed.origins</param-name>
      <param-value>https://trusted1.org,https://trusted2.org</param-value> <!-- Compliant -->
      </init-param>
      </filter>
      ```

      ```xml Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Using clear-text protocols is security-sensitive">
    <div class="paragraph">
      <p>Clear-text protocols such as \`ftp, telnet, or http lack
      encryption of transported data, as well as the capability to build an
      authenticated connection. It means that an attacker able to sniff traffic from
      the network can read, modify, or corrupt the transported content. These
      protocols are not secure as they expose applications to an extensive range of
      risks:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>sensitive data exposure</p>
        </li>

        <li>
          <p>traffic redirected  to a malicious endpoint</p>
        </li>

        <li>
          <p>malware-infected software update or installer</p>
        </li>

        <li>
          <p>execution of client-side code</p>
        </li>

        <li>
          <p>corruption of critical information</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>Even in the context of isolated networks like offline environments or segmented
      cloud environments, the insider threat exists. Thus, attacks involving
      communications being sniffed or tampered with can still happen.</p>
    </div>

    <div class="paragraph">
      <p>For example, attackers could successfully compromise prior security layers by:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>bypassing isolation mechanisms</p>
        </li>

        <li>
          <p>compromising a component of the network</p>
        </li>

        <li>
          <p>getting the credentials of an internal IAM account (either from a service
          account or an actual person)</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>In such cases, encrypting communications would decrease the chances of attackers
      to successfully leak data or steal credentials from other network components.
      By layering various security practices (segmentation and encryption, for
      example), the application will follow the <em>defense-in-depth</em> principle.</p>
    </div>

    <div class="paragraph">
      <p>Note that using the http\` protocol is being deprecated by
      <a href="https://blog.mozilla.org/security/2015/04/30/deprecating-non-secure-http">major web browsers</a>.</p>
    </div>

    <div class="paragraph">
      <p>In the past, it has led to the following vulnerabilities:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p><a href="https://nvd.nist.gov/vuln/detail/CVE-2019-6169">CVE-2019-6169</a></p>
        </li>

        <li>
          <p><a href="https://nvd.nist.gov/vuln/detail/CVE-2019-12327">CVE-2019-12327</a></p>
        </li>

        <li>
          <p><a href="https://nvd.nist.gov/vuln/detail/CVE-2019-11065">CVE-2019-11065</a></p>
        </li>
      </ul>
    </div>

    <CodeGroup>
      ```xml Bad theme={null}
      <application
      android:usesCleartextTraffic="true"> <!-- Sensitive -->
      </application>
      ```

      ```xml Fix theme={null}
      <application> <!-- Sensitive -->
      </application>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Creating cookies without the HttpOnly flag is security-sensitive">
    <div class="paragraph">
      <p>When a cookie is configured with the <code>HttpOnly attribute set to <em>true</em>, the browser guaranties that no client-side script will be able to read it. In most cases, when a cookie is created, the default value of HttpOnly is <em>false</em> and it’s up to the developer to decide whether or not the content of the cookie can be read by the client-side script. As a majority of Cross-Site Scripting (XSS) attacks target the theft of session-cookies, the HttpOnly</code> attribute can help to reduce their impact as it won’t be possible to exploit the XSS vulnerability to steal session-cookies.</p>
    </div>

    <CodeGroup>
      ```xml Bad theme={null}
      <session-config>
      <cookie-config>
      <http-only>true</http-only> <!-- Compliant -->
      </cookie-config>
      </session-config>
      ```

      ```xml Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Disabling auto-escaping in template engines is security-sensitive">
    <div class="paragraph">
      <p>To reduce the risk of cross-site scripting attacks, templating systems, such as \`Twig,  Django,  Smarty,  Groovy's template engine, allow configuration of automatic variable escaping before rendering templates. When escape occurs, characters that make sense to the browser (eg: \<a>) will be transformed/replaced with escaped/sanitized values (eg: & lt;a& gt; ).</p>
    </div>

    <div class="paragraph">
      <p>Auto-escaping is not a magic feature to annihilate all cross-site scripting attacks, it depends on <a href="https://twig.symfony.com/doc/3.x/filters/escape.html">the strategy applied</a> and the context, for example a "html auto-escaping" strategy  (which only transforms html characters into <a href="https://developer.mozilla.org/en-US/docs/Glossary/Entity">html entities</a>) will not be relevant when variables are used in a <a href="https://en.wikipedia.org/wiki/HTML_attribute">html attribute</a> because ':’ character is not escaped and thus an attack as below is possible:</p>
    </div>

    <div class="listingblock">
      <div class="content">
        <pre>\<a href="\{\{ myLink }}">link\</a> // myLink = javascript:alert(document.cookie)
        \<a href="javascript:alert(document.cookie)">link\</a> // JS injection (XSS attack)</pre>
      </div>
    </div>

    <CodeGroup>
      ```xml Bad theme={null}
      <!-- Java Spring defaultHtmlEscape parameter, in web.xml -->

      <context-param>
      <param-name>defaultHtmlEscape</param-name>
      <param-value>true</param-value><!-- Compliant -->
      </context-param>
      ```

      ```xml Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Receiving intents is security-sensitive">
    <div class="paragraph">
      <p>Android applications can receive broadcasts from the system or other applications. Receiving intents is security-sensitive. For example, it has led in the past to the following vulnerabilities:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p><a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1677">CVE-2019-1677</a></p>
        </li>

        <li>
          <p><a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-1275">CVE-2015-1275</a></p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>Receivers can be declared in the manifest or in the code to make them context-specific. If the receiver is declared in the manifest Android will start the application if it is not already running once a matching broadcast is received. The receiver is an entry point into the application.</p>
    </div>

    <div class="paragraph">
      <p>Other applications can send potentially malicious broadcasts, so it is important to consider broadcasts as untrusted and to limit the applications that can send broadcasts to the receiver.</p>
    </div>

    <div class="paragraph">
      <p>Permissions can be specified to restrict broadcasts to authorized applications. Restrictions can be enforced by both the sender and receiver of a broadcast. If permissions are specified when registering a broadcast receiver, then only broadcasters who were granted this permission can send a message to the receiver.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when a receiver is registered without specifying any broadcast permission.</p>
    </div>

    <CodeGroup>
      ```xml Bad theme={null}
      <receiver android:name=".MyBroadcastReceiver" android:exported="true">  <!-- Sensitive -->
      <intent-filter>
          <action android:name="android.intent.action.AIRPLANE_MODE"/>
      </intent-filter>
      </receiver>
      ```

      ```xml Fix theme={null}
      <receiver android:name=".MyBroadcastReceiver"
      android:permission="android.permission.SEND_SMS"
      android:exported="true">
      <intent-filter>
          <action android:name="android.intent.action.AIRPLANE_MODE"/>
      </intent-filter>
      </receiver>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Track uses of TODO tags">
    <div class="paragraph">
      <p>Developers often use TODO tags to mark areas in the code where additional work or improvements are needed but are not implemented immediately.
      However, these TODO tags sometimes get overlooked or forgotten, leading to incomplete or unfinished code.
      This rule aims to identify and address unattended TODO tags to ensure a clean and maintainable codebase.
      This description explores why this is a problem and how it can be fixed to improve the overall code quality.</p>
    </div>

    <CodeGroup>
      ```xml Bad theme={null}
      <!-- TODO Drop this dependency -->
      <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.8.1</version>
      </dependency>
      ```

      ```xml Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Hard-coded credentials are security-sensitive">
    <div class="paragraph">
      <p>Because it is easy to extract strings from an application source code or binary, credentials should not be hard-coded. This is particularly true for applications that are distributed or that are open-source.</p>
    </div>

    <div class="paragraph">
      <p>In the past, it has led to the following vulnerabilities:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p><a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-13466">CVE-2019-13466</a></p>
        </li>

        <li>
          <p><a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-15389">CVE-2018-15389</a></p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>Credentials should be stored outside of the code in a configuration file, a database, or a management service for secrets.</p>
    </div>

    <div class="paragraph">
      <p>This rule flags instances of hard-coded credentials used in database and LDAP connections. It looks for hard-coded credentials in connection strings, and for variable names that match any of the patterns from the provided list.</p>
    </div>

    <div class="paragraph">
      <p>It’s recommended to customize the configuration of this rule with additional credential words such as "oauthToken", "secret", …​</p>
    </div>

    <CodeGroup>
      ```xml Bad theme={null}
      @Configuration
      public class SocialConfig implements SocialConfigurer {

      @Override
      public void addConnectionFactories(ConnectionFactoryConfigurer cfConfig, Environment env) {
          cfConfig.addConnectionFactory(new TwitterConnectionFactory(
              env.getProperty("twitter.consumerKey"),    
              env.getProperty("twitter.consumerSecret")));  <!-- Compliant --> 
      }
      }
      ```

      ```xml Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Source code should be indented consistently">
    <div class="paragraph">
      <p>Consistent indentation is a simple and effective way to improve the code’s readability.
      It reduces the differences that are committed to source control systems, making code reviews easier.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when the indentation does not match the configured value.
      Only the first line of a badly indented section is reported.</p>
    </div>

    <CodeGroup>
      ```xml Bad theme={null}
      <?xml version="1.0"?>
      <catalog>
      <book id="bk101">
      <author>Gambardella, Matthew</author>
       <title>XML Developer's Guide</title>  <!-- Noncompliant, expected to start at column 4 -->
      <genre>Computer</genre>
      <price>44.95</price>
      <publish_date>2000-10-01</publish_date>
      <description>An in-depth look at creating applications 
      with XML.</description>
      </book>
      <book id="bk102">  <!-- Noncompliant, expected to start at column 2 -->
        <author>Ralls, Kim</author>
        <title>Midnight Rain</title>
        <genre>Fantasy</genre>
        <price>5.95</price>
        <publish_date>2000-12-16</publish_date>
        <description>A former architect battles corporate zombies, 
        an evil sorceress, and her own childhood to become queen 
        of the world.</description>
      </book>
      </catalog>
      ```

      ```xml Fix theme={null}
      <?xml version="1.0"?>
      <catalog>
      <book id="bk101">
      <author>Gambardella, Matthew</author>
      <title>XML Developer's Guide</title>
      <genre>Computer</genre>
      <price>44.95</price>
      <publish_date>2000-10-01</publish_date>
      <description>An in-depth look at creating applications 
      with XML.</description>
      </book>
      <book id="bk102">
      <author>Ralls, Kim</author>
      <title>Midnight Rain</title>
      <genre>Fantasy</genre>
      <price>5.95</price>
      <publish_date>2000-12-16</publish_date>
      <description>A former architect battles corporate zombies, 
      an evil sorceress, and her own childhood to become queen 
      of the world.</description>
      </book>
      </catalog>
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>
