1. 程式人生 > >最多的代碼錯誤

最多的代碼錯誤

task present min implicit syn multi sprint aps substr

1.pvs_studio_V730

msg="Not all members of a class are initialized inside the constructor. Consider inspecting: createdDateTime, modifiedDateTime."

技術分享圖片

2.pvs_studio_V595

msg="The ‘browser‘ pointer was utilized before it was verified against nullptr. Check lines: 280, 283."

技術分享圖片

3.pvs_studio_V721

msg="The VARIANT_BOOL type is utilized incorrectly. The true value (VARIANT_TRUE) is defined as -1. Check: ((& isPreview)->boolVal) = m_isPreview."

技術分享圖片

4.pvs_studio_V811

msg="Decreased performance. Excessive type casting: string -> char * -> string. Consider inspecting first argument of the function fileExists."

技術分享圖片

5.pvs_studio_V547

msg="Expression ‘j >= 0‘ is always true. Unsigned type value is always >= 0."

技術分享圖片

6.pvs_studio_V716

msg="Suspicious type conversion in assign expression: ‘BOOL = HRESULT‘."

技術分享圖片

7.pvs_studio_V745

msg="A ‘wchar_t *‘ type string is incorrectly converted to ‘BSTR‘ type string. Consider using ‘SysAllocString‘ function."

技術分享圖片

8.pvs_studio_V746

msg="Type slicing. An exception should be caught by reference rather than by value."

技術分享圖片

9.pvs_studio_V724

msg="Converting type ‘int‘ to type ‘VARIANT_BOOL‘ can lead to a loss of high-order bits. Non-zero value can become ‘FALSE‘."

技術分享圖片

10.pvs_studio_V814

msg="Decreased performance. Calls to the ‘wcslen‘ function have being made multiple times when a condition for the loop‘s continuation was calculated."

技術分享圖片

11.pvs_studio_V575

msg="The null pointer is passed into ‘memcpy‘ function. Inspect the second argument."

技術分享圖片

12.pvs_studio_V501

msg="There are identical sub-expressions to the left and to the right of the ‘!=‘ operator: m_fitMode != m_fitMode"

技術分享圖片

13.pvs_studio_V512

msg="A call of the ‘memset‘ function will lead to underflow of the buffer ‘lpszHeadInfo‘."

技術分享圖片

14.pvs_studio_V523

msg="The ‘then‘ statement is equivalent to the ‘else‘ statement."

技術分享圖片

15.pvs_studio_V567

msg="Undefined behavior. The ‘m_pixmapIndex‘ variable is modified while being used twice between sequence points."

技術分享圖片

16.pvs_studio_V570

msg="The ‘height‘ variable is assigned to itself."

技術分享圖片

17.pvs_studio_V576

msg="Incorrect format. Consider checking the third actual argument of the ‘wsprintfW‘ function. To print the value of pointer the ‘%p‘ should be used."

技術分享圖片

18.pvs_studio_V704

msg=‘this == nullptr‘ expression should be avoided - this expression is always false on newer compilers, because ‘this‘ pointer can never be NULL.

技術分享圖片

19.pvs_studio_V763

msg="Parameter ‘handle‘ is always rewritten in function body before being used."

技術分享圖片

20.pvs_studio_V510

msg="The ‘Format‘ function is not expected to receive class-type variable as second actual argument."

技術分享圖片

21.pvs_studio_V522

msg="Dereferencing of the null pointer ‘pTask‘ might take place. Check the logical condition."

技術分享圖片

22.pvs_studio_V599

msg="The destructor was not declared as a virtual one, although the ‘KAutoSaveItem‘ class contains virtual functions."

技術分享圖片

23.pvs_studio_V607

msg="Ownerless expression ‘Download_Fail‘.

技術分享圖片

24.pvs_studio_V672

msg="There is probably no need in creating the new ‘context‘ variable here. One of the function‘s arguments possesses the same name and this argument is a reference.

技術分享圖片

25.pvs_studio_V517

msg="The use of ‘if (A) {...} else if (A) {...}‘ pattern was detected. There is a probability of logical error presence. Check lines: 47, 59."

技術分享圖片

26.pvs_studio_V561

msg="It‘s probably better to assign value to ‘hr‘ variable than to declare it anew. Previous declaration: kolfontqhbcommand.cpp, line 343."

技術分享圖片

27.pvs_studio_V571

msg="Recurring check. The ‘if (!layout)‘ condition was already verified in line 1032

技術分享圖片

28.pvs_studio_V611

msg="The memory was allocated using ‘new T[]‘ operator but was released using the ‘delete‘ operator. Consider inspecting this code. It‘s probably better to use ‘delete [] buffer;‘.

技術分享圖片

29.pvs_studio_V674

msg="The literal ‘10.5‘ of ‘double‘ type is being implicitly cast to ‘int‘ type while calling the ‘setPointSize‘ function. Inspect the first argument."

技術分享圖片

30.pvs_studio_V541

msg="It is dangerous to print the string ‘strParam‘ into itself."

技術分享圖片

31.pvs_studio_V542

msg="Consider inspecting an odd type cast: ‘unsigned short‘ to ‘wchar_t *‘."

技術分享圖片

32.pvs_studio_V629

msg="Consider inspecting the ‘0x1 << (- * pStateBase[curState])‘ expression. Bit shifting of the 32-bit value with a subsequent expansion to the 64-bit type."

技術分享圖片

33.pvs_studio_V521

msg="Such expressions using the ‘,‘ operator are dangerous. Make sure the expression is correct."

技術分享圖片

34.pvs_studio_V554

msg="Incorrect use of unique_ptr. The memory allocated with ‘new []‘ will be cleaned using ‘delete‘."

技術分享圖片

35.pvs_studio_V734

msg="An excessive check. Examine the conditions containing search for the substrings "*.dot" and "*.dotm"."

技術分享圖片

36.pvs_studio_V528

msg="It is odd that pointer to ‘wchar_t‘ type is compared with the L‘\0‘ value. Probably meant: *pPath == L‘\0‘."

技術分享圖片

37.pvs_studio_V590

msg="Consider inspecting the ‘lResult == 0L && lResult != 234L‘ expression. The expression is excessive or contains a misprint."

技術分享圖片

38.pvs_studio_V617

msg="Consider inspecting the condition. The ‘SizeY_FitContent‘ argument of the ‘|‘ bitwise operation contains a non-zero value."

技術分享圖片

39.pvs_studio_V712

msg="Be advised that compiler may delete this cycle or make it infinity. Use volatile variable(s) or synchronization primitives to avoid this."

技術分享圖片

40.pvs_studio_V502

msg="Perhaps the ‘?:‘ operator works in a different way than it was expected. The ‘?:‘ operator has a lower priority than the ‘==‘ operator."

技術分享圖片

41.pvs_studio_V557

msg="Array overrun is possible. The ‘16‘ index is pointing beyond array bound."

技術分享圖片

42.pvs_studio_V625

msg="Consider inspecting the ‘for‘ operator. Initial and final values of the iterator are the same."

技術分享圖片

43.pvs_studio_V682

msg="Suspicious literal is present: ‘/0‘. It is possible that a backslash should be used here instead: ‘\0‘."

技術分享圖片

44.pvs_studio_V766

msg="An item with the same key ‘L"secretKey"‘ has already been added."

技術分享圖片

45.pvs_studio_V767

msg="Suspicious access to element of ‘fileList‘ array by a constant index inside a loop.

技術分享圖片

最多的代碼錯誤