<dd id="sga4y"><optgroup id="sga4y"></optgroup></dd>
<nav id="sga4y"><code id="sga4y"></code></nav>
  • <optgroup id="sga4y"></optgroup>

    Poor Style: Redundant Initialization

    ABSTRACT

    變量賦值后并不使用,而變成了一個死存儲。

    EXPLANATION

    沒有使用該變量的初始值。初始化之后,變量或者被重新賦值,或者轉向作用域之外。

    例:以下摘錄的代碼為變量 r 賦值,并在沒有使用所賦數值的情況下,對其加以重寫。


    int r = getNum();
    r = getNewNum(buf);

    REFERENCES

    [1] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3050 CAT II

    [2] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3050 CAT II

    [3] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 398


    Copyright 2013 Fortify Software - All rights reserved.
    (Generated from version 2013.1.1.0008 of the Fortify Secure Coding Rulepacks)
    desc.structural.java.poor_style_redundant_initialization

    97av