From 5d26ecd31da038831f4a2d68a5b3a2ecafbafdbb Mon Sep 17 00:00:00 2001 From: jfiat Date: Wed, 4 Jun 2014 15:46:29 +0000 Subject: [PATCH] Author:admin Date:2014-06-04T15:46:29.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1373 abb3cda0-5349-4a8f-a601-0c33ac3a8c38 --- .../ca001-self-assignment.wiki | 9 +++---- .../ca071-self-comparison.wiki | 25 +++++++++++++------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/eiffel-inspector/eiffel-inspector-rules/ca001-self-assignment.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/eiffel-inspector/eiffel-inspector-rules/ca001-self-assignment.wiki index 1af43ead..fcb4988f 100644 --- a/documentation/current/eiffelstudio/eiffelstudio-reference/eiffel-inspector/eiffel-inspector-rules/ca001-self-assignment.wiki +++ b/documentation/current/eiffelstudio/eiffelstudio-reference/eiffel-inspector/eiffel-inspector-rules/ca001-self-assignment.wiki @@ -3,11 +3,7 @@ [[Property:weight|0]] [[Property:uuid|d98b7fb8-37a1-05b3-a58f-baacefd5dce6]] __NOTOC__ -=Description= -Assigning a variable to itself is a meaningless instruction due to a typing error. Most probably, one of the two variable names was misspelled. One example among many others: the programmer wanted to assign a local variable to a class attribute and used one of the variable names twice. - -=Details= -{| +:{| |- | '''Scope''' | Instruction @@ -25,6 +21,9 @@ Assigning a variable to itself is a meaningless instruction due to a typing erro | 70 |} +=Description= +Assigning a variable to itself is a meaningless instruction due to a typing error. Most probably, one of the two variable names was misspelled. One example among many others: the programmer wanted to assign a local variable to a class attribute and used one of the variable names twice. + =Example= a := a diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/eiffel-inspector/eiffel-inspector-rules/ca071-self-comparison.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/eiffel-inspector/eiffel-inspector-rules/ca071-self-comparison.wiki index 850b3df5..b1d960d7 100644 --- a/documentation/current/eiffelstudio/eiffelstudio-reference/eiffel-inspector/eiffel-inspector-rules/ca071-self-comparison.wiki +++ b/documentation/current/eiffelstudio/eiffelstudio-reference/eiffel-inspector/eiffel-inspector-rules/ca071-self-comparison.wiki @@ -3,16 +3,27 @@ [[Property:weight|0]] [[Property:uuid|02a649b3-0e4e-6fdf-388d-c411a06fc787]] __NOTOC__ +:{| class="wikitable" +|- +| '''Scope''' +| Instruction +|- +| '''Enabled''' +| Yes +|- +| '''Severity''' +| Warning +|- +| '''Applicability''' +| All +|- +| '''Score''' +| 70 +|} + =Description= An expression comparing a variable to itself always evaluates to the same boolean value. The comparison is thus redundant. In an Until expression it may lead to non-termination. Usually it is a typing error. -=Details= -*Scope: Instruction -*Enabled: Yes -*Severity: Warning -*Applicability: All -*Score: 70 - =Example= if a >= a then ...