|
1class NotesController < ApplicationController
|
|
|
|
3 before_action :authenticate
|
|
|
|
|
|
|
- Complexity 4 » saikuro
- Method "getNotesList" has 24 lines. It should have 20 or less. » roodi
- Method name "getNotesList" should match pattern /^[_a-z<>=\[\]|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/ » roodi
- DuplicateMethodCall - calls n.created_at 2 times » reek
- DuplicateMethodCall - calls n.created_at.to_s 2 times » reek
- TooManyStatements - has approx 13 statements » reek
- UncommunicativeMethodName - has the name 'getNotesList' » reek
- UncommunicativeVariableName - has the variable name 'h' » reek
- UncommunicativeVariableName - has the variable name 'k' » reek
- UncommunicativeVariableName - has the variable name 'n' » reek
- UncommunicativeVariableName - has the variable name 'v' » reek
- FeatureEnvy - refers to n more than self » reek
|
|
|
|
|
9 pid = params[:project_id]
|
|
10 uid = session[:user_id]
|
|
11 notes = Note.where("user_id = ? AND project_id = ? ",uid,pid).order("created_at desc").all
|
|
12 note = Hash.new do |h,k|
|
|
|
|
|
|
|
|
16 date = n.created_at.to_s[/([\d\-]*)\s(.*)/,1]
|
|
17 time = n.created_at.to_s[/(.*)\s([\d\:]*)/,2]
|
|
|
|
19 :content => n.content,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|