<bdo id='wmvHe'></bdo><ul id='wmvHe'></ul>
    1. <small id='wmvHe'></small><noframes id='wmvHe'>

      <i id='wmvHe'><tr id='wmvHe'><dt id='wmvHe'><q id='wmvHe'><span id='wmvHe'><b id='wmvHe'><form id='wmvHe'><ins id='wmvHe'></ins><ul id='wmvHe'></ul><sub id='wmvHe'></sub></form><legend id='wmvHe'></legend><bdo id='wmvHe'><pre id='wmvHe'><center id='wmvHe'></center></pre></bdo></b><th id='wmvHe'></th></span></q></dt></tr></i><div id='wmvHe'><tfoot id='wmvHe'></tfoot><dl id='wmvHe'><fieldset id='wmvHe'></fieldset></dl></div>

        <tfoot id='wmvHe'></tfoot><legend id='wmvHe'><style id='wmvHe'><dir id='wmvHe'><q id='wmvHe'></q></dir></style></legend>

        鱿鱼:Android 上的最大继承深度

        时间:2024-05-09
          <bdo id='fcPPf'></bdo><ul id='fcPPf'></ul>
            <legend id='fcPPf'><style id='fcPPf'><dir id='fcPPf'><q id='fcPPf'></q></dir></style></legend>
            <i id='fcPPf'><tr id='fcPPf'><dt id='fcPPf'><q id='fcPPf'><span id='fcPPf'><b id='fcPPf'><form id='fcPPf'><ins id='fcPPf'></ins><ul id='fcPPf'></ul><sub id='fcPPf'></sub></form><legend id='fcPPf'></legend><bdo id='fcPPf'><pre id='fcPPf'><center id='fcPPf'></center></pre></bdo></b><th id='fcPPf'></th></span></q></dt></tr></i><div id='fcPPf'><tfoot id='fcPPf'></tfoot><dl id='fcPPf'><fieldset id='fcPPf'></fieldset></dl></div>

                • <tfoot id='fcPPf'></tfoot>
                • <small id='fcPPf'></small><noframes id='fcPPf'>

                    <tbody id='fcPPf'></tbody>
                  本文介绍了鱿鱼:Android 上的最大继承深度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  这是我的设置:

                  • SonarQube 5.6.6
                  • SonarJava 插件 4.8.0.9441

                  代码:

                  public class BaseActivity extends android.app.Activity {}
                  
                  public class FooActivity extends BaseActivity {}
                  

                  SonarQube 认为 FooActivity 违反 squid:MaximumInheritanceDepth:

                  SonarQube thinks that FooActivity violates squid:MaximumInheritanceDepth:

                  这个班级有 6 个家长,超过 5 个授权.

                  This class has 6 parents which is greater than 5 authorized.

                  android.app.Activity 是 Android 原生 API.Activity 的任何超类在计算违反此规则时是否应该被忽略?

                  android.app.Activity is Android Native API. Shouldn't any super classes of Activity be ignored when calculating violations for this rule?

                  这是一个错误吗?

                  推荐答案

                  这不是bug,而是配置问题.规则 squid:S110 可以配置为过滤掉类从继承树.默认情况下,不会忽略任何类,规则只是计算继承级别的数量,直到达到 Object 类.为了配置过滤类,您必须设置 filteredClasses 规则属性.

                  This is not a bug, but rather a configuration issue. Rule squid:S110 can be configured to filter out classes from the inheritance tree. By default, no class is ignored and the rule simply count the number of inheritance levels till reaching Object class. In order to configure filtered classes, you have to set up the filteredClasses rule property.

                  请注意,计划更新规则以不简单地从总继承深度中排除过滤类,而是在达到过滤类后立即停止增加继承级别.该修复将在处理 Jira 票证 SONARJAVA-2252 时完成.

                  Note that it is plan to update to rule to not simply exclude filtered classes from the total inheritance depth, but stop incrementing inheritance levels as soon as reaching a filtered class. The fix will be done when handling Jira ticket SONARJAVA-2252.

                  这篇关于鱿鱼:Android 上的最大继承深度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:声纳:如何使用 try-with-resources 关闭 FileOutputStream 下一篇:SonarLint V3:“Serializable"中的字段;对于 List 接口,类应该是瞬态的或可序列化

                  相关文章

                  <i id='APLGJ'><tr id='APLGJ'><dt id='APLGJ'><q id='APLGJ'><span id='APLGJ'><b id='APLGJ'><form id='APLGJ'><ins id='APLGJ'></ins><ul id='APLGJ'></ul><sub id='APLGJ'></sub></form><legend id='APLGJ'></legend><bdo id='APLGJ'><pre id='APLGJ'><center id='APLGJ'></center></pre></bdo></b><th id='APLGJ'></th></span></q></dt></tr></i><div id='APLGJ'><tfoot id='APLGJ'></tfoot><dl id='APLGJ'><fieldset id='APLGJ'></fieldset></dl></div>

                  <small id='APLGJ'></small><noframes id='APLGJ'>

                    • <bdo id='APLGJ'></bdo><ul id='APLGJ'></ul>

                    <tfoot id='APLGJ'></tfoot>

                    1. <legend id='APLGJ'><style id='APLGJ'><dir id='APLGJ'><q id='APLGJ'></q></dir></style></legend>