/[eiffelstudio]/branches/eth/eve/Src/framework/code_analysis/localization/ca_messages.e
ViewVC logotype

Contents of /branches/eth/eve/Src/framework/code_analysis/localization/ca_messages.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 93427 - (show annotations)
Tue Nov 19 10:39:06 2013 UTC (6 years, 3 months ago) by zurfluhs
File size: 4659 byte(s)
Code Analyzer: added rule 'unneeded object test local'.
1 note
2 description: "Summary description for {CA_MESSAGES}."
3 author: ""
4 date: "$Date$"
5 revision: "$Revision$"
6
7 frozen class
8 CA_MESSAGES
9
10 inherit {NONE}
11 SHARED_LOCALE
12
13 feature -- Utility functions
14
15 -- wrapped_string (a_input: READABLE_STRING_GENERAL; a_max_count: INTEGER; a_force_wrap: BOOLEAN): READABLE_STRING_GENERAL
16 -- --
17 -- require
18 -- a_max_count >= 5
19 -- local
20 -- l_words: LIST[READABLE_STRING_GENERAL]
21 -- l_word: READABLE_STRING_GENERAL
22 -- l_output: STRING_32
23 -- l_current_line_char_count, j: INTEGER
24 -- do
25 -- if a_input.count <= a_max_count then
26 -- -- The trivial case.
27 -- Result := a_input
28 -- else
29 -- from
30 -- l_current_line_char_count := 0
31 -- l_output.make_empty
32 -- l_words := a_input.split (' ')
33 -- l_words.start
34 -- until
35 -- l_words.after
36 -- loop
37 -- l_word := l_words.item
38 -- if l_word.count > a_max_count and then a_force_wrap then -- A very long word.
39 -- if l_current_line_char_count /= 0 then
40 -- l_output.append_character ('%N')
41 -- end
42 -- from
43 -- j := 1
44 -- until
45 -- j + a_max_count > l_word.count
46 -- loop
47 -- l_output.append (l_word.substring (j, j + a_max_count - 1))
48 -- l_output.append_character ('%N')
49 -- j := j + a_max_count
50 -- end
51 -- l_output.append (l_word.substring (j, l_word.count))
52 -- else
53 -- if l_current_line_char_count + l_word.count > a_max_count then
54 -- if l_current_line_char_count /= 0 then
55 -- l_output.append_character ('%N')
56 -- end
57 -- current_line_char_count := l_word.count
58 -- else
59 -- l_output.append_character (' ')
60 -- current_line_char_count := current_line_char_count + 1 + l_word.count
61 -- end
62 -- l_output.append (l_word)
63 -- end
64
65 -- l_words.forth
66 -- end
67
68 -- Result := l_output
69 -- end
70 -- ensure
71 -- length_preserved: (not a_force_wrap) implies (a_input.count = Result.count) -- Make sure 'LF CR' new lines count as 1.
72 -- end
73
74 feature -- Code Analyzer
75
76 analyzing_class (a_class_name: READABLE_STRING_GENERAL): STRING_32
77 do Result := locale.formatted_string (locale.translation ("Analyzing class $1 ...%N"), [a_class_name]) end
78
79
80 self_assignment_violation_1: STRING_32
81 do Result := locale.translation ("Variable '") end
82
83 self_assignment_violation_2: STRING_32
84 do Result := locale.translation ("' is assigned to itself. Assigning a variable to %
85 %itself is%Na meaningless statement due to a typing%
86 % error. Most probably, one of the two%Nvariable %
87 %names was misspelled.") end
88
89 unused_argument_violation_1: STRING_32
90 do Result := locale.translation ("Arguments ") end
91
92 unused_argument_violation_2: STRING_32
93 do Result := locale.translation (" from routine '") end
94
95 unused_argument_violation_3: STRING_32
96 do Result := locale.translation ("' are not used.") end
97
98 npath_violation_1: STRING_32
99 do Result := locale.translation ("Routine '") end
100
101 npath_violation_2: STRING_32
102 do Result := locale.translation ("' has an NPATH measure of ") end
103
104 npath_violation_3: STRING_32
105 do Result := locale.translation (", which is greater than the defined%Nmaximum of ") end
106
107 feature_never_called_violation_1: STRING_32
108 do Result := locale.translation ("Feature '") end
109
110 feature_never_called_violation_2: STRING_32
111 do Result := locale.translation ("' is never called by any class.") end
112
113 cq_separation_violation_1 : STRING_32
114 do Result := locale.translation ("Function '") end
115
116 cq_separation_violation_2: STRING_32
117 do Result := locale.translation ("' contains a procedure call, assigns to an%
118 % attribute, or%Ncreates an attribute. This indicates that the function%
119 % changes the state of the%Nobject, which is a violation of the %
120 %command-query separation principle.") end
121
122 unneeded_object_test_violation_1: STRING_32
123 do Result := locale.translation ("' is either a local variable, a feature argument, or an%Nobject test local. Thus the object test is not in need of the object test local%N'") end
124
125 feature -- Command Line
126
127 cmd_class: STRING_32
128 do Result := locale.translation ("%NIn class '") end
129
130 cmd_help_message: STRING_32
131 do Result := locale.translation ("Code Analysis performs static analyses on the source code and %
132 %outputs a list of issues found according to a set of rules.") end
133
134 cmd_class_not_found_1: STRING_32
135 do Result := locale.translation ("Warning: class '") end
136
137 cmd_class_not_found_2: STRING_32
138 do Result := locale.translation ("' was not found and will be skipped. Check the spelling %
139 %and make sure the class has been compiled.%N") end
140
141 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date ID Revision

  ViewVC Help
Powered by ViewVC 1.1.23