码迷,mamicode.com
首页 > 其他好文 > 详细

Codacy Quality Check

时间:2018-04-10 11:44:48      阅读:276      评论:0      收藏:0      [点我收藏+]

标签:Codacy   Code Style   

Codacy Quality CheckList
  • Variable ‘var‘ is reassigned a value before the old one has been used.

    double scaleFactor = 1.0;
    UnitTypeEnum bodyLenUnit = kUnitType_NULL;
    object->LengthUnit(bodyLenUnit);
    scaleFactor = ParasolidBridgeUtility::UnitScaleFactor(bodyLenUnit);
  • 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 )
    {
        ...
    }

Codacy Quality Check

标签:Codacy   Code Style   

原文地址:http://blog.51cto.com/xqtyler/2096395

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!