User:Nnatara2

Implementation
The files in the project include duplicated code which violates DRY concept and is to be removed. The various changes that can be made to the files are explained.

1. Similar code found in 1 other location

When there is duplicated code within the file or between files of the same project, the code can be created as a function with variables that are assigned based on the different cases. This function can be called wherever the functionality is required to be fulfilled and also by passing the required parameters. This makes the code more readable and in fact, much easier to understand. By writing similar lines of code again and again, we only increase the number of lines and decrease the efficiency of the code.

2. Use   instead of dynamic .

In the different spec files,  function is used to identify variables according to their name. can be used to match the argument with the variable directly, instead of making sure if the function parameters are matching with the given file.

3. Refactoring - Extract Method,Extract Class,Form Template Method,Introduce Null Object,Pull Up Method,Pull Up Field,Substitute Algorithm

Refactoring is the process of improving a source code without altering the external behavior. It improves Extensibility and Maintainability. We can implement refactoring using one of the methods mentioned above.

4. Useless Assignments of Variables

Same variables may be assigned values through the program which may not be used later. These assignments are said to be useless as the new value never gets used anywhere. These lines can be removed from the program as they do not implement anything and are of no use.

5.Do not use   without

To use the current time in the program, we need use  instead of. The latter uses the system's date and time as it is part of the Ruby standard library. It is better to use Time.zone.now because it returns the time that is corrected according to our corresponding Time zone as it has been extended by ActiveSupport.

6. Indentation

Programs need to be indented properly. 2 White spaces are used to write statements within any block. Accordingly, the end of the block statements also follow the corresponding white spaces. Indentation improves code readability and makes it easy for the user/programmer to understand what happens within the program.