Nitsmell : Adding new code smells and print console updated
[nit.git] / tests / TestNitsmells / LongMethod / longmethod.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 # A test program with a fake model to check model tools.
16 module longmethod
17
18 import platform
19
20 class Starter
21 var attribute = 0
22 var attribute1 = 0
23 var attribute2 = 0
24 fun start do
25 self.attribute1 = 10
26 end
27
28 fun ended do end
29 end
30
31 class LongMethodClass
32 var test_variable = 0
33
34 fun long_method do
35 var starter = new Starter
36 test_variable = 3
37 end
38
39 fun extra_long_method do
40 var starter = new Starter
41 test_variable = 3
42 test_variable = 5
43 test_variable = 8
44 end
45 end