Codacy Quality Check

Codacy Quality CheckList

  • Variable 'var' is reassigned a value before the old one has been used.

    double scaleFactor = 1;
    scaleFactor = GetUnitScale();
  • Prefer prefix ++/-- operators for non-primitive types.

    for (iter=innerLoopVec.begin(); innerLoopVec.end()!=iter; iter++)
    {
    ...
    }
  • Assignment of function parameter has no effect outside the function.

    void Foo(A* pA) 
    {
    delete pA;
    pA = nullptr;
    }
  • Class 'XXX' has a constructor with 1 argument that is not explicit.

    class A
    {
    public:
    A(int){} //default contruct won't be provided
    };
  • The scope of the variable 'var' can be reduced.
  • Array index 'j' is used before limits check.

    while ( name.Text[j] != '>' && j < name.TextLength )
    {
        ...
    }
  • Boolean result is used in bitwise operation. Clarify expression with parentheses.
    
    if (symbolTxt.Substr(0, 2) == "<T" | symbolTxt.Substr(0, 2) == "<V")
    {
    ...
    }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章