ambition/tmp/metric_fu/report.yml

5626 lines
178 KiB
YAML
Raw Normal View History

2017-01-03 10:51:58 +08:00
---
:flay:
:total_score: '268'
:matches:
- :reason: 1) Similar code found in :defn (mass = 160)
:matches:
- :name: app/models/comment.rb
:line: '23'
- :name: app/models/mission.rb
:line: '36'
- :name: app/models/missions_user.rb
:line: '10'
- :name: app/models/missions_user.rb
:line: '20'
- :name: app/models/note.rb
:line: '32'
- :name: app/models/note.rb
:line: '41'
- :name: app/models/projects_user.rb
:line: '11'
- :name: app/models/projects_user.rb
:line: '20'
- :name: app/models/share.rb
:line: '20'
- :name: app/models/share.rb
:line: '28'
- :reason: 2) Similar code found in :lasgn (mass = 40)
:matches:
- :name: app/controllers/projects_controller.rb
:line: '66'
- :name: app/controllers/projects_controller.rb
:line: '92'
- :reason: 3) Similar code found in :defn (mass = 36)
:matches:
- :name: app/models/mission.rb
:line: '22'
- :name: app/models/note.rb
:line: '24'
- :reason: 4) Similar code found in :defn (mass = 32)
:matches:
- :name: app/controllers/users_controller.rb
:line: '11'
- :name: app/controllers/users_controller.rb
:line: '19'
:rails_best_practices:
:total:
- Found 31 errors.
:problems:
- :file: "/home/ccx/RubymineProjects/ambition/db/schema.rb"
:line: '16'
:problem: always add db index (comments => [user_id])
:url: http://rails-bestpractices.com/posts/2010/07/24/always-add-db-index/
- :file: "/home/ccx/RubymineProjects/ambition/db/schema.rb"
:line: '26'
:problem: always add db index (missions => [project_id])
:url: http://rails-bestpractices.com/posts/2010/07/24/always-add-db-index/
- :file: "/home/ccx/RubymineProjects/ambition/db/schema.rb"
:line: '37'
:problem: always add db index (missions_users => [mission_id])
:url: http://rails-bestpractices.com/posts/2010/07/24/always-add-db-index/
- :file: "/home/ccx/RubymineProjects/ambition/db/schema.rb"
:line: '37'
:problem: always add db index (missions_users => [user_id])
:url: http://rails-bestpractices.com/posts/2010/07/24/always-add-db-index/
- :file: "/home/ccx/RubymineProjects/ambition/db/schema.rb"
:line: '42'
:problem: always add db index (notes => [project_id])
:url: http://rails-bestpractices.com/posts/2010/07/24/always-add-db-index/
- :file: "/home/ccx/RubymineProjects/ambition/db/schema.rb"
:line: '60'
:problem: always add db index (projects_users => [project_id])
:url: http://rails-bestpractices.com/posts/2010/07/24/always-add-db-index/
- :file: "/home/ccx/RubymineProjects/ambition/db/schema.rb"
:line: '60'
:problem: always add db index (projects_users => [user_id])
:url: http://rails-bestpractices.com/posts/2010/07/24/always-add-db-index/
- :file: "/home/ccx/RubymineProjects/ambition/db/schema.rb"
:line: '65'
:problem: always add db index (shares => [project_id])
:url: http://rails-bestpractices.com/posts/2010/07/24/always-add-db-index/
- :file: "/home/ccx/RubymineProjects/ambition/db/schema.rb"
:line: '65'
:problem: always add db index (shares => [user_id])
:url: http://rails-bestpractices.com/posts/2010/07/24/always-add-db-index/
- :file: "/home/ccx/RubymineProjects/ambition/app/controllers/missions_controller.rb"
:line: '48'
:problem: move model logic into model (mission use_count > 4)
:url: http://rails-bestpractices.com/posts/2010/07/21/move-model-logic-into-the-model/
- :file: "/home/ccx/RubymineProjects/ambition/app/controllers/missions_controller.rb"
:line: '87'
:problem: move model logic into model (mission use_count > 4)
:url: http://rails-bestpractices.com/posts/2010/07/21/move-model-logic-into-the-model/
- :file: "/home/ccx/RubymineProjects/ambition/app/controllers/missions_controller.rb"
:line: '113'
:problem: move model logic into model (mission use_count > 4)
:url: http://rails-bestpractices.com/posts/2010/07/21/move-model-logic-into-the-model/
- :file: "/home/ccx/RubymineProjects/ambition/app/helpers/users_helper.rb"
:line: '1'
:problem: remove empty helpers
:url: http://rails-bestpractices.com/posts/2011/04/09/remove-empty-helpers/
- :file: "/home/ccx/RubymineProjects/ambition/app/helpers/sessions_helper.rb"
:line: '1'
:problem: remove empty helpers
:url: http://rails-bestpractices.com/posts/2011/04/09/remove-empty-helpers/
- :file: "/home/ccx/RubymineProjects/ambition/app/controllers/shares_controller.rb"
:line: '10'
:problem: use model association (for share)
:url: http://rails-bestpractices.com/posts/2010/07/19/use-model-association/
- :file: "/home/ccx/RubymineProjects/ambition/Gemfile"
:line: '37'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/app/models/note.rb"
:line: '2'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/app/models/project.rb"
:line: '5'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/app/models/missions_user.rb"
:line: '2'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/app/models/projects_user.rb"
:line: '2'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/app/models/share.rb"
:line: '2'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/app/models/comment.rb"
:line: '2'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/app/models/mission.rb"
:line: '4'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/db/migrate/20161229084919_change_note_field_type_to_category.rb"
:line: '3'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/app/controllers/notes_controller.rb"
:line: '2'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/app/controllers/shares_controller.rb"
:line: '2'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/app/controllers/sessions_controller.rb"
:line: '7'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/app/controllers/missions_controller.rb"
:line: '2'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/app/controllers/projects_controller.rb"
:line: '2'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/config/routes.rb"
:line: '65'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
- :file: "/home/ccx/RubymineProjects/ambition/config/application.rb"
:line: '25'
:problem: remove trailing whitespace
:url: http://rails-bestpractices.com/posts/2010/12/02/remove-trailing-whitespace/
:churn:
:changes:
- :file_path: app/controllers/projects_controller.rb
:times_changed: 16
- :file_path: db/schema.rb
:times_changed: 12
:class_churn:
- klass:
file: app/controllers/missions_controller.rb
klass: MissionsController
times_changed: 1
:method_churn:
- method:
file: app/controllers/missions_controller.rb
klass: MissionsController
method: MissionsController#detail
times_changed: 1
- method:
file: app/controllers/missions_controller.rb
klass: MissionsController
method: MissionsController#create
times_changed: 1
- method:
file: app/controllers/missions_controller.rb
klass: MissionsController
method: MissionsController#update
times_changed: 1
- method:
file: app/controllers/missions_controller.rb
klass: MissionsController
method: MissionsController#commentPublish
times_changed: 1
:changed_files:
- ".gitignore"
- ".metrics"
- Gemfile
- db/schema.rb
- spec/controllers/sessions_controller_spec.rb
- spec/controllers/users_controller_spec.rb
- spec/models/user_spec.rb
:changed_classes: []
:changed_methods: []
:saikuro:
:files:
- :classes:
- :class_name: ProjectsController
:complexity: 13
:lines: 149
:methods:
- :name: ProjectsController#update
:complexity: 2
:lines: 7
- :name: ProjectsController#detail
:complexity: 2
:lines: 31
- :name: ProjectsController#deleteUsers
:complexity: 2
:lines: 21
- :name: ProjectsController#addUsers
:complexity: 2
:lines: 20
- :name: ProjectsController#create
:complexity: 2
:lines: 9
- :name: ProjectsController#index
:complexity: 2
:lines: 23
- :name: ProjectsController#project_params
:complexity: 1
:lines: 2
:filename: app/controllers/projects_controller.rb
- :classes:
- :class_name: MissionsController
:complexity: 12
:lines: 153
:methods:
- :name: MissionsController#create
:complexity: 3
:lines: 22
- :name: MissionsController#detail
:complexity: 3
:lines: 36
- :name: MissionsController#commentPublish
:complexity: 2
:lines: 12
- :name: MissionsController#update
:complexity: 2
:lines: 24
- :name: MissionsController#getlist
:complexity: 2
:lines: 31
:filename: app/controllers/missions_controller.rb
- :classes:
- :class_name: UsersController
:complexity: 10
:lines: 52
:methods:
- :name: UsersController#update
:complexity: 2
:lines: 7
- :name: UsersController#create
:complexity: 2
:lines: 7
- :name: UsersController#usernameExist
:complexity: 2
:lines: 6
- :name: UsersController#emailExist
:complexity: 2
:lines: 6
- :name: UsersController#user_params
:complexity: 1
:lines: 2
- :name: UsersController#checkExist?
:complexity: 1
:lines: 2
:filename: app/controllers/users_controller.rb
- :classes:
- :class_name: Note
:complexity: 8
:lines: 49
:methods:
- :name: Note#project_exist
:complexity: 2
:lines: 7
- :name: Note#user_exist
:complexity: 2
:lines: 7
- :name: Note#note_category_should_among_valid_values
:complexity: 2
:lines: 6
- :name: Note#note_has_atleast_one_character
:complexity: 2
:lines: 5
:filename: app/models/note.rb
- :classes:
- :class_name: SharesController
:complexity: 6
:lines: 54
:methods:
- :name: SharesController#create
:complexity: 3
:lines: 17
- :name: SharesController#getShareList
:complexity: 2
:lines: 18
- :name: SharesController#share_params
:complexity: 1
:lines: 2
:filename: app/controllers/shares_controller.rb
- :classes:
- :class_name: Mission
:complexity: 6
:lines: 46
:methods:
- :name: Mission#project_exists
:complexity: 2
:lines: 8
- :name: Mission#status_is_among_valid_values
:complexity: 2
:lines: 5
- :name: Mission#priority_is_among_valid_values
:complexity: 2
:lines: 5
:filename: app/models/mission.rb
- :classes:
- :class_name: Share
:complexity: 6
:lines: 36
:methods:
- :name: Share#project_exists
:complexity: 2
:lines: 7
- :name: Share#user_exists
:complexity: 2
:lines: 7
- :name: Share#share_has_atleast_one_character
:complexity: 2
:lines: 5
:filename: app/models/share.rb
- :classes:
- :class_name: SessionsController
:complexity: 4
:lines: 28
:methods:
- :name: SessionsController#create
:complexity: 2
:lines: 8
- :name: SessionsController#show
:complexity: 1
:lines: 2
- :name: SessionsController#destroy
:complexity: 1
:lines: 4
:filename: app/controllers/sessions_controller.rb
- :classes:
- :class_name: NotesController
:complexity: 4
:lines: 36
:methods:
- :name: NotesController#getNotesList
:complexity: 4
:lines: 28
:filename: app/controllers/notes_controller.rb
- :classes:
- :class_name: ApplicationController
:complexity: 4
:lines: 15
:methods:
- :name: ApplicationController#current_user
:complexity: 2
:lines: 2
- :name: ApplicationController#authenticate
:complexity: 2
:lines: 2
:filename: app/controllers/application_controller.rb
- :classes:
- :class_name: Comment
:complexity: 4
:lines: 43
:methods:
- :name: Comment#user_id_exist
:complexity: 2
:lines: 7
- :name: Comment#comment_has_atleast_one_character
:complexity: 2
:lines: 5
:filename: app/models/comment.rb
- :classes:
- :class_name: Missions_user
:complexity: 4
:lines: 29
:methods:
- :name: Missions_user#user_exist
:complexity: 2
:lines: 7
- :name: Missions_user#mission_exist
:complexity: 2
:lines: 8
:filename: app/models/missions_user.rb
- :classes:
- :class_name: Projects_user
:complexity: 4
:lines: 28
:methods:
- :name: Projects_user#user_exists
:complexity: 2
:lines: 7
- :name: Projects_user#project_exists
:complexity: 2
:lines: 7
:filename: app/models/projects_user.rb
- :classes:
- :class_name: Project
:complexity: 2
:lines: 14
:methods:
- :name: Project#require_at_least_on_user
:complexity: 2
:lines: 4
:filename: app/models/project.rb
- :classes:
- :class_name: ApplicationHelper
:complexity: 0
:lines: 1
:methods: []
:filename: app/helpers/application_helper.rb
- :classes:
- :class_name: SessionsHelper
:complexity: 0
:lines: 1
:methods: []
:filename: app/helpers/sessions_helper.rb
- :classes:
- :class_name: UsersHelper
:complexity: 0
:lines: 1
:methods: []
:filename: app/helpers/users_helper.rb
- :classes:
- :class_name: User
:complexity: 0
:lines: 14
:methods: []
:filename: app/models/user.rb
:classes:
- :name: ProjectsController
:complexity: 13
:lines: 149
:defs:
- :name: ProjectsController#index
:complexity: 2
:lines: 23
- :name: ProjectsController#create
:complexity: 2
:lines: 9
- :name: ProjectsController#addUsers
:complexity: 2
:lines: 20
- :name: ProjectsController#deleteUsers
:complexity: 2
:lines: 21
- :name: ProjectsController#detail
:complexity: 2
:lines: 31
- :name: ProjectsController#update
:complexity: 2
:lines: 7
- :name: ProjectsController#project_params
:complexity: 1
:lines: 2
- :name: MissionsController
:complexity: 12
:lines: 153
:defs:
- :name: MissionsController#getlist
:complexity: 2
:lines: 31
- :name: MissionsController#detail
:complexity: 3
:lines: 36
- :name: MissionsController#create
:complexity: 3
:lines: 22
- :name: MissionsController#update
:complexity: 2
:lines: 24
- :name: MissionsController#commentPublish
:complexity: 2
:lines: 12
- :name: UsersController
:complexity: 10
:lines: 52
:defs:
- :name: UsersController#emailExist
:complexity: 2
:lines: 6
- :name: UsersController#usernameExist
:complexity: 2
:lines: 6
- :name: UsersController#create
:complexity: 2
:lines: 7
- :name: UsersController#update
:complexity: 2
:lines: 7
- :name: UsersController#checkExist?
:complexity: 1
:lines: 2
- :name: UsersController#user_params
:complexity: 1
:lines: 2
- :name: Note
:complexity: 8
:lines: 49
:defs:
- :name: Note#note_has_atleast_one_character
:complexity: 2
:lines: 5
- :name: Note#note_category_should_among_valid_values
:complexity: 2
:lines: 6
- :name: Note#user_exist
:complexity: 2
:lines: 7
- :name: Note#project_exist
:complexity: 2
:lines: 7
- :name: Share
:complexity: 6
:lines: 36
:defs:
- :name: Share#share_has_atleast_one_character
:complexity: 2
:lines: 5
- :name: Share#user_exists
:complexity: 2
:lines: 7
- :name: Share#project_exists
:complexity: 2
:lines: 7
- :name: Mission
:complexity: 6
:lines: 46
:defs:
- :name: Mission#priority_is_among_valid_values
:complexity: 2
:lines: 5
- :name: Mission#status_is_among_valid_values
:complexity: 2
:lines: 5
- :name: Mission#project_exists
:complexity: 2
:lines: 8
- :name: SharesController
:complexity: 6
:lines: 54
:defs:
- :name: SharesController#create
:complexity: 3
:lines: 17
- :name: SharesController#getShareList
:complexity: 2
:lines: 18
- :name: SharesController#share_params
:complexity: 1
:lines: 2
- :name: Projects_user
:complexity: 4
:lines: 28
:defs:
- :name: Projects_user#project_exists
:complexity: 2
:lines: 7
- :name: Projects_user#user_exists
:complexity: 2
:lines: 7
- :name: Missions_user
:complexity: 4
:lines: 29
:defs:
- :name: Missions_user#mission_exist
:complexity: 2
:lines: 8
- :name: Missions_user#user_exist
:complexity: 2
:lines: 7
- :name: Comment
:complexity: 4
:lines: 43
:defs:
- :name: Comment#comment_has_atleast_one_character
:complexity: 2
:lines: 5
- :name: Comment#user_id_exist
:complexity: 2
:lines: 7
- :name: ApplicationController
:complexity: 4
:lines: 15
:defs:
- :name: ApplicationController#authenticate
:complexity: 2
:lines: 2
- :name: ApplicationController#current_user
:complexity: 2
:lines: 2
- :name: NotesController
:complexity: 4
:lines: 36
:defs:
- :name: NotesController#getNotesList
:complexity: 4
:lines: 28
- :name: SessionsController
:complexity: 4
:lines: 28
:defs:
- :name: SessionsController#create
:complexity: 2
:lines: 8
- :name: SessionsController#destroy
:complexity: 1
:lines: 4
- :name: SessionsController#show
:complexity: 1
:lines: 2
- :name: Project
:complexity: 2
:lines: 14
:defs:
- :name: Project#require_at_least_on_user
:complexity: 2
:lines: 4
- :name: User
:complexity: 0
:lines: 14
- :name: UsersHelper
:complexity: 0
:lines: 1
- :name: SessionsHelper
:complexity: 0
:lines: 1
- :name: ApplicationHelper
:complexity: 0
:lines: 1
:methods:
- :name: NotesController#getNotesList
:complexity: 4
:lines: 28
- :name: SharesController#create
:complexity: 3
:lines: 17
- :name: MissionsController#create
:complexity: 3
:lines: 22
- :name: MissionsController#detail
:complexity: 3
:lines: 36
- :name: Project#require_at_least_on_user
:complexity: 2
:lines: 4
- :name: Projects_user#user_exists
:complexity: 2
:lines: 7
- :name: Projects_user#project_exists
:complexity: 2
:lines: 7
- :name: Missions_user#user_exist
:complexity: 2
:lines: 7
- :name: Missions_user#mission_exist
:complexity: 2
:lines: 8
- :name: Comment#user_id_exist
:complexity: 2
:lines: 7
- :name: Comment#comment_has_atleast_one_character
:complexity: 2
:lines: 5
- :name: ApplicationController#current_user
:complexity: 2
:lines: 2
- :name: ApplicationController#authenticate
:complexity: 2
:lines: 2
- :name: SessionsController#create
:complexity: 2
:lines: 8
- :name: Share#project_exists
:complexity: 2
:lines: 7
- :name: Share#user_exists
:complexity: 2
:lines: 7
- :name: Share#share_has_atleast_one_character
:complexity: 2
:lines: 5
- :name: Mission#project_exists
:complexity: 2
:lines: 8
- :name: Mission#status_is_among_valid_values
:complexity: 2
:lines: 5
- :name: Mission#priority_is_among_valid_values
:complexity: 2
:lines: 5
- :name: SharesController#getShareList
:complexity: 2
:lines: 18
- :name: Note#project_exist
:complexity: 2
:lines: 7
- :name: Note#user_exist
:complexity: 2
:lines: 7
- :name: Note#note_category_should_among_valid_values
:complexity: 2
:lines: 6
- :name: Note#note_has_atleast_one_character
:complexity: 2
:lines: 5
- :name: UsersController#update
:complexity: 2
:lines: 7
- :name: UsersController#create
:complexity: 2
:lines: 7
- :name: UsersController#usernameExist
:complexity: 2
:lines: 6
- :name: UsersController#emailExist
:complexity: 2
:lines: 6
- :name: MissionsController#commentPublish
:complexity: 2
:lines: 12
- :name: MissionsController#update
:complexity: 2
:lines: 24
- :name: MissionsController#getlist
:complexity: 2
:lines: 31
- :name: ProjectsController#update
:complexity: 2
:lines: 7
- :name: ProjectsController#detail
:complexity: 2
:lines: 31
- :name: ProjectsController#deleteUsers
:complexity: 2
:lines: 21
- :name: ProjectsController#addUsers
:complexity: 2
:lines: 20
- :name: ProjectsController#create
:complexity: 2
:lines: 9
- :name: ProjectsController#index
:complexity: 2
:lines: 23
- :name: SessionsController#show
:complexity: 1
:lines: 2
- :name: SessionsController#destroy
:complexity: 1
:lines: 4
- :name: SharesController#share_params
:complexity: 1
:lines: 2
- :name: UsersController#user_params
:complexity: 1
:lines: 2
- :name: UsersController#checkExist?
:complexity: 1
:lines: 2
- :name: ProjectsController#project_params
:complexity: 1
:lines: 2
:roodi:
:total:
- Checked 18 files
:problems:
- :file: app/models/missions_user.rb
:line: '1'
:problem: Class name "Missions_user" should match pattern /^[A-Z][a-zA-Z0-9]*$/
- :file: app/models/projects_user.rb
:line: '1'
:problem: Class name "Projects_user" should match pattern /^[A-Z][a-zA-Z0-9]*$/
- :file: app/controllers/notes_controller.rb
:line: '7'
:problem: Method "getNotesList" has 24 lines. It should have 20 or less.
- :file: app/controllers/missions_controller.rb
:line: '13'
:problem: Method "getlist" has 27 lines. It should have 20 or less.
- :file: app/controllers/missions_controller.rb
:line: '48'
:problem: Method "detail" has 24 lines. It should have 20 or less.
- :file: app/controllers/missions_controller.rb
:line: '113'
:problem: Method "update" has 23 lines. It should have 20 or less.
- :file: app/controllers/projects_controller.rb
:line: '103'
:problem: Method "detail" has 23 lines. It should have 20 or less.
- :file: app/controllers/notes_controller.rb
:line: '7'
:problem: Method name "getNotesList" should match pattern /^[_a-z<>=\[\]|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/
- :file: app/controllers/shares_controller.rb
:line: '31'
:problem: Method name "getShareList" should match pattern /^[_a-z<>=\[\]|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/
- :file: app/controllers/users_controller.rb
:line: '11'
:problem: Method name "emailExist" should match pattern /^[_a-z<>=\[\]|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/
- :file: app/controllers/users_controller.rb
:line: '19'
:problem: Method name "usernameExist" should match pattern /^[_a-z<>=\[\]|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/
- :file: app/controllers/users_controller.rb
:line: '46'
:problem: Method name "checkExist?" should match pattern /^[_a-z<>=\[\]|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/
- :file: app/controllers/missions_controller.rb
:line: '141'
:problem: Method name "commentPublish" should match pattern /^[_a-z<>=\[\]|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/
- :file: app/controllers/projects_controller.rb
:line: '55'
:problem: Method name "addUsers" should match pattern /^[_a-z<>=\[\]|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/
- :file: app/controllers/projects_controller.rb
:line: '78'
:problem: Method name "deleteUsers" should match pattern /^[_a-z<>=\[\]|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/
:stats:
:codeLOC: 560
:testLOC: 782
:code_to_test_ratio: 1.4
:lines:
- :name: Controllers
:lines: 494
:loc: 381
:classes: 7
:methods: 27
:methods_per_class: 3
:loc_per_method: 12
- :name: Helpers
:lines: 6
:loc: 6
:classes: 0
:methods: 0
:methods_per_class: 0
:loc_per_method: 0
- :name: Models
:lines: 267
:loc: 173
:classes: 8
:methods: 17
:methods_per_class: 2
:loc_per_method: 8
- :name: Mailers
:lines: 0
:loc: 0
:classes: 0
:methods: 0
:methods_per_class: 0
:loc_per_method: 0
- :name: Javascripts
:lines: 22
:loc: 0
:classes: 0
:methods: 0
:methods_per_class: 0
:loc_per_method: 0
- :name: Libraries
:lines: 0
:loc: 0
:classes: 0
:methods: 0
:methods_per_class: 0
:loc_per_method: 0
- :name: Models specs
:lines: 534
:loc: 388
:classes: 0
:methods: 0
:methods_per_class: 0
:loc_per_method: 0
- :name: Controllers specs
:lines: 573
:loc: 394
:classes: 0
:methods: 0
:methods_per_class: 0
:loc_per_method: 0
- :name: Total
:lines: 1896
:loc: 1342
:classes: 15
:methods: 44
:methods_per_class: 2
:loc_per_method: 28
:reek:
:matches:
- :file_path: app/controllers/application_controller.rb
:code_smells:
- :method: ApplicationController
:message: has no descriptive comment
:type: IrresponsibleModule
:lines:
- 1
- :method: ApplicationController#current_user
:message: calls session[:user_id] 2 times
:type: DuplicateMethodCall
:lines:
- 12
- 12
- :file_path: app/models/comment.rb
:code_smells:
- :method: Comment#user_id_exist
:message: performs a nil-check
:type: NilCheck
:lines:
- 26
- :file_path: app/models/mission.rb
:code_smells:
- :method: Mission
:message: has no descriptive comment
:type: IrresponsibleModule
:lines:
- 1
- :method: Mission#project_exists
:message: performs a nil-check
:type: NilCheck
:lines:
- 40
- :file_path: app/controllers/missions_controller.rb
:code_smells:
- :method: MissionsController
:message: has no descriptive comment
:type: IrresponsibleModule
:lines:
- 1
- :method: MissionsController#commentPublish
:message: has approx 7 statements
:type: TooManyStatements
:lines:
- 141
- :method: MissionsController#commentPublish
:message: has the name 'commentPublish'
:type: UncommunicativeMethodName
:lines:
- 141
- :method: MissionsController#create
:message: calls user_enties.id 2 times
:type: DuplicateMethodCall
:lines:
- 100
- 105
- :method: MissionsController#create
:message: has approx 14 statements
:type: TooManyStatements
:lines:
- 87
- :method: MissionsController#detail
:message: has approx 14 statements
:type: TooManyStatements
:lines:
- 48
- :method: MissionsController#detail
:message: has the variable name 'c'
:type: UncommunicativeVariableName
:lines:
- 63
- :method: MissionsController#detail
:message: refers to mission more than self
:type: FeatureEnvy
:lines:
- 48
- :method: MissionsController#getlist
:message: has approx 7 statements
:type: TooManyStatements
:lines:
- 13
- :method: MissionsController#update
:message: calls user_enties.id 2 times
:type: DuplicateMethodCall
:lines:
- 127
- 132
- :method: MissionsController#update
:message: has approx 17 statements
:type: TooManyStatements
:lines:
- 113
- :file_path: app/models/missions_user.rb
:code_smells:
- :method: Missions_user
:message: has no descriptive comment
:type: IrresponsibleModule
:lines:
- 1
- :method: Missions_user#mission_exist
:message: performs a nil-check
:type: NilCheck
:lines:
- 13
- :method: Missions_user#user_exist
:message: performs a nil-check
:type: NilCheck
:lines:
- 23
- :file_path: app/models/note.rb
:code_smells:
- :method: Note
:message: has no descriptive comment
:type: IrresponsibleModule
:lines:
- 1
- :method: Note#project_exist
:message: performs a nil-check
:type: NilCheck
:lines:
- 44
- :method: Note#user_exist
:message: performs a nil-check
:type: NilCheck
:lines:
- 35
- :file_path: app/controllers/notes_controller.rb
:code_smells:
- :method: NotesController
:message: has no descriptive comment
:type: IrresponsibleModule
:lines:
- 1
- :method: NotesController#getNotesList
:message: calls n.created_at 2 times
:type: DuplicateMethodCall
:lines:
- 16
- 17
- :method: NotesController#getNotesList
:message: calls n.created_at.to_s 2 times
:type: DuplicateMethodCall
:lines:
- 16
- 17
- :method: NotesController#getNotesList
:message: has approx 13 statements
:type: TooManyStatements
:lines:
- 7
- :method: NotesController#getNotesList
:message: has the name 'getNotesList'
:type: UncommunicativeMethodName
:lines:
- 7
- :method: NotesController#getNotesList
:message: has the variable name 'h'
:type: UncommunicativeVariableName
:lines:
- 12
- :method: NotesController#getNotesList
:message: has the variable name 'k'
:type: UncommunicativeVariableName
:lines:
- 12
- 25
- :method: NotesController#getNotesList
:message: has the variable name 'n'
:type: UncommunicativeVariableName
:lines:
- 15
- :method: NotesController#getNotesList
:message: has the variable name 'v'
:type: UncommunicativeVariableName
:lines:
- 25
- :method: NotesController#getNotesList
:message: refers to n more than self
:type: FeatureEnvy
:lines:
- 7
- :file_path: app/models/project.rb
:code_smells:
- :method: Project
:message: has no descriptive comment
:type: IrresponsibleModule
:lines:
- 1
- :file_path: app/controllers/projects_controller.rb
:code_smells:
- :method: ProjectsController
:message: has no descriptive comment
:type: IrresponsibleModule
:lines:
- 1
- :method: ProjectsController#addUsers
:message: has approx 14 statements
:type: TooManyStatements
:lines:
- 55
- :method: ProjectsController#addUsers
:message: has the name 'addUsers'
:type: UncommunicativeMethodName
:lines:
- 55
- :method: ProjectsController#addUsers
:message: performs a nil-check
:type: NilCheck
:lines:
- 61
- :method: ProjectsController#deleteUsers
:message: has approx 14 statements
:type: TooManyStatements
:lines:
- 78
- :method: ProjectsController#deleteUsers
:message: has the name 'deleteUsers'
:type: UncommunicativeMethodName
:lines:
- 78
- :method: ProjectsController#deleteUsers
:message: performs a nil-check
:type: NilCheck
:lines:
- 84
- :method: ProjectsController#detail
:message: has approx 9 statements
:type: TooManyStatements
:lines:
- 103
- :method: ProjectsController#detail
:message: has the variable name 'i'
:type: UncommunicativeVariableName
:lines:
- 113
- :method: ProjectsController#index
:message: has approx 10 statements
:type: TooManyStatements
:lines:
- 14
- :method: ProjectsController#index
:message: has the variable name 'i'
:type: UncommunicativeVariableName
:lines:
- 18
- :method: ProjectsController#index
:message: has the variable name 'p'
:type: UncommunicativeVariableName
:lines:
- 20
- :file_path: app/models/projects_user.rb
:code_smells:
- :method: Projects_user
:message: has no descriptive comment
:type: IrresponsibleModule
:lines:
- 1
- :method: Projects_user#project_exists
:message: performs a nil-check
:type: NilCheck
:lines:
- 14
- :method: Projects_user#user_exists
:message: performs a nil-check
:type: NilCheck
:lines:
- 23
- :file_path: app/controllers/sessions_controller.rb
:code_smells:
- :method: SessionsController
:message: has no descriptive comment
:type: IrresponsibleModule
:lines:
- 1
- :file_path: app/models/share.rb
:code_smells:
- :method: Share
:message: has no descriptive comment
:type: IrresponsibleModule
:lines:
- 1
- :method: Share#project_exists
:message: performs a nil-check
:type: NilCheck
:lines:
- 31
- :method: Share#user_exists
:message: performs a nil-check
:type: NilCheck
:lines:
- 23
- :file_path: app/controllers/shares_controller.rb
:code_smells:
- :method: SharesController
:message: has no descriptive comment
:type: IrresponsibleModule
:lines:
- 1
- :method: SharesController#create
:message: has approx 11 statements
:type: TooManyStatements
:lines:
- 10
- :method: SharesController#create
:message: has the variable name 'i'
:type: UncommunicativeVariableName
:lines:
- 18
- :method: SharesController#getShareList
:message: calls i.content 2 times
:type: DuplicateMethodCall
:lines:
- 37
- 42
- :method: SharesController#getShareList
:message: has approx 7 statements
:type: TooManyStatements
:lines:
- 31
- :method: SharesController#getShareList
:message: has the name 'getShareList'
:type: UncommunicativeMethodName
:lines:
- 31
- :method: SharesController#getShareList
:message: has the variable name 'i'
:type: UncommunicativeVariableName
:lines:
- 36
- :method: SharesController#getShareList
:message: refers to i more than self
:type: FeatureEnvy
:lines:
- 31
- :file_path: app/models/user.rb
:code_smells:
- :method: User
:message: has no descriptive comment
:type: IrresponsibleModule
:lines:
- 1
- :file_path: app/controllers/users_controller.rb
:code_smells:
- :method: UsersController
:message: has no descriptive comment
:type: IrresponsibleModule
:lines:
- 1
- :method: UsersController#checkExist?
:message: doesn't depend on instance state
:type: UtilityFunction
:lines:
- 46
- :method: UsersController#checkExist?
:message: has the name 'checkExist?'
:type: UncommunicativeMethodName
:lines:
- 46
- :method: UsersController#emailExist
:message: has the name 'emailExist'
:type: UncommunicativeMethodName
:lines:
- 11
- :method: UsersController#usernameExist
:message: has the name 'usernameExist'
:type: UncommunicativeMethodName
:lines:
- 19
:rcov:
"./app/controllers/application_controller.rb":
:lines:
- :content: class ApplicationController < ActionController::Base
:was_run: 1
- :content: " # Prevent CSRF attacks by raising an exception."
:was_run:
- :content: " # For APIs, you may want to use :null_session instead."
:was_run:
- :content: " protect_from_forgery with: :exception"
:was_run: 1
- :content: " def authenticate"
:was_run: 1
- :content: " render status: :unauthorized, nothing: true unless session['user_id']"
:was_run: 1
- :content: " end"
:was_run:
- :content: " private"
:was_run: 1
- :content: " def current_user"
:was_run: 1
- :content: " @current_user ||= User.find(session[:user_id]) if session[:user_id]"
:was_run: 1
- :content: " end"
:was_run:
- :content: " helper_method :current_user"
:was_run: 1
- :content: end
:was_run:
:percent_run: 100
:methods:
ApplicationController#authenticate: 0.0
ApplicationController#current_user: 0.0
"./app/controllers/missions_controller.rb":
:lines:
- :content: class MissionsController < ApplicationController
:was_run: 1
- :content: " "
:was_run:
- :content: " before_action :authenticate"
:was_run: 1
- :content: " skip_before_action :verify_authenticity_token, :only => ["
:was_run: 1
- :content: " :create,"
:was_run:
- :content: " :getlist,"
:was_run:
- :content: " :detail,"
:was_run:
- :content: " :update,"
:was_run:
- :content: " :commentPublish"
:was_run:
- :content: " ]"
:was_run:
- :content: !binary |-
ICAgICM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT7o
jrflj5blvZPliY3pobnnm67mn5DnirbmgIHnmoTku7vliqHliJfooag=
:was_run:
- :content: " "
:was_run:
- :content: " def getlist"
:was_run: 1
- :content: " #Todo"
:was_run:
- :content: " pid = params[:project_id]"
:was_run: 1
- :content: " stu = params[:status_type]"
:was_run: 1
- :content: " #missions = []"
:was_run:
- :content: " details = []"
:was_run: 1
- :content: ' missions = Mission.where("project_id = ? AND status = ?",pid,stu).all'
:was_run: 1
- :content: " "
:was_run:
- :content: " missions.each do |mission|"
:was_run: 1
- :content: " "
:was_run:
- :content: " #puts mission.inspect"
:was_run:
- :content: " "
:was_run:
- :content: " details += [{"
:was_run: 1
- :content: " :id => mission.id,"
:was_run:
- :content: " :name => mission.name,"
:was_run:
- :content: " :content => mission.content"
:was_run:
- :content: " }]"
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " # Mission.where(:project_id => pid).where(:status => stu) do
|i|"
:was_run:
- :content: " # missions += [{"
:was_run:
- :content: " # :id => i.id,"
:was_run:
- :content: " # :name => i.name,"
:was_run:
- :content: " # :content => i.content"
:was_run:
- :content: " # }]"
:was_run:
- :content: " # end"
:was_run:
- :content: " render :json => {"
:was_run: 1
- :content: " :code => 0,"
:was_run:
- :content: " :data => missions"
:was_run:
- :content: " }"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: !binary |-
ICAgICM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT7o
jrflj5bku7vliqHor6bnu4bkv6Hmga8=
:was_run:
- :content: " "
:was_run:
- :content: " def detail"
:was_run: 1
- :content: " #Todo"
:was_run:
- :content: " username = []"
:was_run: 1
- :content: " comments_s = []"
:was_run: 1
- :content: " mission_id = params[:id]"
:was_run: 1
- :content: " mission = Mission.find_by(id: mission_id)"
:was_run: 1
- :content: ' m_us = Missions_user.where("mission_id = ?",mission_id).all'
:was_run: 1
- :content: " #puts m_us.inspect"
:was_run:
- :content: " m_us.each do |m_u|"
:was_run: 1
- :content: " user_id = m_u.user_id"
:was_run: 0
- :content: " user = User.find_by(id: user_id)"
:was_run: 0
- :content: " #puts user.inspect"
:was_run:
- :content: " username << user.name"
:was_run: 0
- :content: " end"
:was_run:
- :content: ' comments = Comment.where("mission_id = ?",mission_id).all'
:was_run: 1
- :content: " comments.each do |c|"
:was_run: 1
- :content: " uname = User.find_by(id: c.user_id).name"
:was_run: 1
- :content: " comments_s += [{"
:was_run: 1
- :content: " :nickname => uname,"
:was_run:
- :content: " :content => c.content,"
:was_run:
- :content: " :time => c.created_at"
:was_run:
- :content: " }]"
:was_run:
- :content: " end"
:was_run:
- :content: " #puts comments_s.inspect"
:was_run:
- :content: " render :json => {"
:was_run: 1
- :content: " :code => 0,"
:was_run:
- :content: " :data => {"
:was_run:
- :content: " :name => mission.name,"
:was_run:
- :content: " :content => mission.content,"
:was_run:
- :content: " :priority => mission.priority,"
:was_run:
- :content: " :status => mission.status,"
:was_run:
- :content: " :deadline => mission.deadline,"
:was_run:
- :content: " :users => username,"
:was_run:
- :content: " :comments => comments_s"
:was_run:
- :content: " }"
:was_run:
- :content: " }"
:was_run:
- :content: " end"
:was_run:
- :content: !binary |-
ICAgICAjPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0+
5Yib5bu65Lu75Yqh
:was_run:
- :content: " "
:was_run:
- :content: " def create"
:was_run: 1
- :content: " #Todo"
:was_run:
- :content: " params_mission = {name: params[:name],project_id: params[:project_id],content:
params[:content],deadline: params[:deadline],priority: params[:priority],status:
params[:status]}"
:was_run: 1
- :content: " mission = Mission.new(params_mission)"
:was_run: 1
- :content: " if mission.save"
:was_run: 1
- :content: " render :json => {:code => 0}"
:was_run: 1
- :content: " else"
:was_run:
- :content: " render json: mission.errors, status: :unprocessable_entity"
:was_run: 0
- :content: " end"
:was_run:
- :content: " userids = params[:users]"
:was_run: 1
- :content: " userids.each do |id|"
:was_run: 1
- :content: " user_enties = User.find_by(id: id)"
:was_run: 1
- :content: " #puts user_enties.inspect"
:was_run:
- :content: " params_mu = {mission_id: mission.id,user_id: user_enties.id}"
:was_run: 1
- :content: " missions_user = Missions_user.new(params_mu)"
:was_run: 0
- :content: " missions_user.save"
:was_run: 0
- :content: !binary |-
ICAgICAgICBjb250ZW50ID0gIuacieaWsOS7u+WKoSA8YT4iK21pc3Npb24u
bmFtZSsiPC9hPiI=
:was_run: 0
- :content: " "
:was_run:
- :content: " params_note = {content: content,user_id: user_enties.id,category:
3,project_id: mission.project_id}"
:was_run: 0
- :content: " note = Note.new(params_note)"
:was_run: 0
- :content: " note.save"
:was_run: 0
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: !binary |-
ICAgICM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT7k
v67mlLnku7vliqHkv6Hmga8=
:was_run:
- :content: " "
:was_run:
- :content: " def update"
:was_run: 1
- :content: " #Todo"
:was_run:
- :content: " "
:was_run:
- :content: " id = params[:id]"
:was_run: 0
- :content: " #now = Datetime.now"
:was_run:
- :content: " mission = Mission.find_by(id: id)"
:was_run: 0
- :content: " params_mission = {name: params[:name],content: params[:content],deadline:
params[:deadline],priority: params[:priority]}"
:was_run: 0
- :content: " #puts params_mission"
:was_run:
- :content: " mission.update(params_mission)"
:was_run: 0
- :content: " mission.save"
:was_run: 0
- :content: ' Missions_user.delete_all(["mission_id = ?",id])'
:was_run: 0
- :content: " userids = params[:users]"
:was_run: 0
- :content: " userids.each do |name|"
:was_run: 0
- :content: " user_enties = User.find_by(id: id)"
:was_run: 0
- :content: " params = {mission_id: id,user_id: user_enties.id}"
:was_run: 0
- :content: " missions_user = Missions_user.new(params)"
:was_run: 0
- :content: " missions_user.save"
:was_run: 0
- :content: !binary |-
ICAgICAgICBjb250ZW50ID0gIjxhPiIrbWlzc2lvbi5uYW1lICsgIjwvYT4g
5Lu75Yqh5L+h5oGv5Y+R55Sf5LqG5Y+Y5YyWIg==
:was_run: 0
- :content: " "
:was_run:
- :content: " params_note = {content: content,user_id: user_enties.id,category:
3,project_id: mission.project_id}"
:was_run: 0
- :content: " note = Note.new(params_note)"
:was_run: 0
- :content: " note.save"
:was_run: 0
- :content: " end"
:was_run:
- :content: " render :json => {:code => 0}"
:was_run: 0
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: !binary |-
ICAgICM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT7l
vZPliY3nlKjmiLflj5Hooajor4Torro=
:was_run:
- :content: " "
:was_run:
- :content: " def commentPublish"
:was_run: 1
- :content: " #Todo"
:was_run:
- :content: " mission_id = params[:mission_id]"
:was_run: 1
- :content: " content = params[:content]"
:was_run: 1
- :content: " user_id = session[:user_id]"
:was_run: 1
- :content: " params = {content: content, mission_id: mission_id, user_id:
user_id}"
:was_run: 1
- :content: " comment = Comment.new(params)"
:was_run: 1
- :content: " if comment.save"
:was_run: 1
- :content: " render :json => {:code => 0}"
:was_run: 1
- :content: " else"
:was_run:
- :content: " render json: mission.errors, status: :unprocessable_entity"
:was_run: 0
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: end
:was_run:
:percent_run: 59
:methods:
MissionsController#getlist: 71.42857142857143
MissionsController#detail: 40.0
MissionsController#create: 27.27272727272727
MissionsController#update: 25.0
MissionsController#commentPublish: 12.5
"./app/controllers/notes_controller.rb":
:lines:
- :content: class NotesController < ApplicationController
:was_run: 1
- :content: " "
:was_run:
- :content: " before_action :authenticate"
:was_run: 1
- :content: " "
:was_run:
- :content: !binary |-
ICAgICPojrflj5bnlKjmiLflvZPliY3nmoTpgJrnn6XliJfooag=
:was_run:
- :content: " "
:was_run:
- :content: " def getNotesList"
:was_run: 1
- :content: " #Todo"
:was_run:
- :content: " pid = params[:project_id]"
:was_run: 1
- :content: " uid = session[:user_id]"
:was_run: 1
- :content: ' notes = Note.where("user_id = ? AND project_id = ? ",uid,pid).order("created_at
desc").all'
:was_run: 1
- :content: " note = Hash.new do |h,k|"
:was_run: 1
- :content: " h[k] = []"
:was_run: 1
- :content: " end"
:was_run:
- :content: " notes.each do |n|"
:was_run: 1
- :content: " date = n.created_at.to_s[/([\\d\\-]*)\\s(.*)/,1]"
:was_run: 1
- :content: " time = n.created_at.to_s[/(.*)\\s([\\d\\:]*)/,2]"
:was_run: 1
- :content: " note[date] << {"
:was_run:
- :content: " :content => n.content,"
:was_run:
- :content: " :time => time,"
:was_run:
- :content: " :type => n.category"
:was_run:
- :content: " }"
:was_run: 1
- :content: " end"
:was_run:
- :content: " data = []"
:was_run: 1
- :content: " note.each do |k,v|"
:was_run: 1
- :content: " data += [{"
:was_run: 1
- :content: " :time => k,"
:was_run:
- :content: " :notes => v"
:was_run:
- :content: " }]"
:was_run:
- :content: " end"
:was_run:
- :content: " render :json => {"
:was_run: 1
- :content: " :code => 0,"
:was_run:
- :content: " :data => data"
:was_run:
- :content: " }"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods:
NotesController#getNotesList: 44.0
"./app/controllers/projects_controller.rb":
:lines:
- :content: class ProjectsController < ApplicationController
:was_run: 1
- :content: " "
:was_run:
- :content: " before_action :authenticate"
:was_run: 1
- :content: " skip_before_action :verify_authenticity_token, :only => ["
:was_run: 1
- :content: " :index,"
:was_run:
- :content: " :create,"
:was_run:
- :content: " :addUsers,"
:was_run:
- :content: " :detail,"
:was_run:
- :content: " :update,"
:was_run:
- :content: " :deleteUsers"
:was_run:
- :content: " ]"
:was_run:
- :content: " "
:was_run:
- :content: !binary |-
ICAgICM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT0+6I635Y+W5oiR55qE6aG555uu5YiX6KGo77yMdXNlcl9pZOS/neWt
mOWcqHNlc3Npb27kuK0u
:was_run:
- :content: " def index"
:was_run: 1
- :content: " #Todo"
:was_run:
- :content: " uid = session[:user_id]"
:was_run: 0
- :content: " data=[]"
:was_run: 0
- :content: " Projects_user.where(:user_id => uid).each do |i|"
:was_run: 0
- :content: " pid=i.project_id"
:was_run: 0
- :content: " p=Project.find_by(id:pid)"
:was_run: 0
- :content: " mc = Mission.where(:project_id => pid).size"
:was_run: 0
- :content: " uc = Projects_user.where(:project_id => pid).size"
:was_run: 0
- :content: " sc = Share.where(:project_id => pid).size"
:was_run: 0
- :content: " data+=[{"
:was_run: 0
- :content: " :id => pid,"
:was_run:
- :content: " :name => p.name,"
:was_run:
- :content: " :content => p.content,"
:was_run:
- :content: " :mission_count => mc,"
:was_run:
- :content: " :users_count => uc,"
:was_run:
- :content: " :shares_count => sc"
:was_run:
- :content: " }]"
:was_run:
- :content: " end"
:was_run:
- :content: " render :json => {"
:was_run: 0
- :content: " :code => 0,"
:was_run:
- :content: " :data => data"
:was_run:
- :content: " }"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: !binary |-
ICAgICM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT0+5Yib5bu66aG555uu
:was_run:
- :content: " "
:was_run:
- :content: " def create"
:was_run: 1
- :content: " uid = session[:user_id]"
:was_run: 1
- :content: " project = Project.new(project_params)"
:was_run: 1
- :content: " if project.save"
:was_run: 0
- :content: " Projects_user.create(project_id:project.id,user_id:uid)"
:was_run: 0
- :content: " render status: :created, nothing: true"
:was_run: 0
- :content: " else"
:was_run:
- :content: " render json: project.errors, status: :unprocessable_entity"
:was_run: 0
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: !binary |-
ICAgICM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT0+6aG555uu5re75Yqg55So5oi3
:was_run:
- :content: " "
:was_run:
- :content: " def addUsers"
:was_run: 1
- :content: !binary |-
ICAgICAgICB1aWQgPSBVc2VyLmZpbmRfYnkoZW1haWw6cGFyYW1zWzplbWFp
bF0pLmlkIyDpnIDopoHmt7vliqDnmoTnlKjmiLc=
:was_run: 1
- :content: !binary |-
ICAgICAgICByZWdpc3RlciA9IHNlc3Npb25bOnVzZXJfaWRdIyDlvZPliY3n
lKjmiLc=
:was_run: 0
- :content: " pid = params[:project_id]"
:was_run: 0
- :content: !binary |-
ICAgICAgICAjIOajgOafpeivpemhueebruS4reaYr+WQpuW3sue7j+acieim
gea3u+WKoOeahOeUqOaItw==
:was_run:
- :content: " pu_exist=Projects_user.find_by(project_id:pid,user_id:uid)"
:was_run: 0
- :content: !binary |-
ICAgICAgICBpZiBwdV9leGlzdC5uaWw/IyDkuI3lrZjlnKg=
:was_run: 0
- :content: " params_pu = {project_id: pid,user_id: uid}"
:was_run: 0
- :content: " pu = Projects_user.new(params_pu)"
:was_run: 0
- :content: " pu.save"
:was_run: 0
- :content: " "
:was_run:
- :content: !binary |-
ICAgICAgICAgICAgY29udGVudCA9ICI8YT4iK1VzZXIuZmluZF9ieShpZDog
cmVnaXN0ZXIpLm5hbWUgKyAiPC9hPiDpgoDor7fmgqjov5vlhaXpobnnm64g
PGE+IiArIFByb2plY3QuZmluZF9ieShpZDogcGlkKS5uYW1lKyI8L2E+Ig==
:was_run: 0
- :content: " puts content"
:was_run: 0
- :content: " params_note = {user_id: uid,content: content,category:
2,project_id: pid}"
:was_run: 0
- :content: " note = Note.new(params_note)"
:was_run: 0
- :content: " note.save!"
:was_run: 0
- :content: " render :json => {:code => 0}"
:was_run: 0
- :content: !binary |-
ICAgICAgICBlbHNlIyDlrZjlnKg=
:was_run:
- :content: " render json:current_user.errors, status: :unprocessable_entity"
:was_run: 0
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: !binary |-
ICAgICM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT0+6aG555uu5Yig6Zmk55So5oi3
:was_run:
- :content: " def deleteUsers"
:was_run: 1
- :content: !binary |-
ICAgICAgICB1aWQgPSBwYXJhbXNbOnVzZXJfaWRdIyDpnIDopoHmt7vliqDn
moTnlKjmiLc=
:was_run: 0
- :content: !binary |-
ICAgICAgICByZWdpc3RlciA9IHNlc3Npb25bOnVzZXJfaWRdIyDlvZPliY3n
lKjmiLc=
:was_run: 0
- :content: " pid = params[:project_id]"
:was_run: 0
- :content: !binary |-
ICAgICAgICAjIOajgOafpeivpemhueebruS4reaYr+WQpuW3sue7j+acieim
gea3u+WKoOeahOeUqOaItw==
:was_run:
- :content: " projects_user=Projects_user.find_by(project_id:pid,user_id:uid)"
:was_run: 0
- :content: !binary |-
ICAgICAgICBpZiBwcm9qZWN0c191c2VyLm5pbD8jIOS4jeWtmOWcqA==
:was_run: 0
- :content: " render json:current_user.errors, status: :unprocessable_entity"
:was_run: 0
- :content: " end"
:was_run:
- :content: !binary |-
ICAgICAgICAjIOWtmOWcqA==
:was_run:
- :content: " puts projects_user.user_id"
:was_run: 0
- :content: " puts projects_user.project_id"
:was_run: 0
- :content: " Projects_user.where(project_id:pid,user_id:uid).delete_all"
:was_run: 0
- :content: " "
:was_run:
- :content: !binary |-
ICAgICAgICBjb250ZW50ID0iPGE+IisgVXNlci5maW5kX2J5KGlkOiByZWdp
c3RlcikubmFtZSArICI8L2E+IOaKiuaCqOS7jumhueebriA8YT4iICsgUHJv
amVjdC5maW5kX2J5KGlkOiBwaWQpLm5hbWUrIjwvYT4g5Lit5Yig6ZmkIg==
:was_run: 0
- :content: " puts content"
:was_run: 0
- :content: " params_note = {user_id: uid,content: content,category: 2,project_id:
pid}"
:was_run: 0
- :content: " note = Note.new(params_note)"
:was_run: 0
- :content: " note.save!"
:was_run: 0
- :content: " "
:was_run:
- :content: " render :json => {:code => 0}"
:was_run: 0
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: !binary |-
ICAgICM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT0+6aG555uu6K+m5oOF
:was_run:
- :content: " "
:was_run:
- :content: " def detail"
:was_run: 1
- :content: " #Todo "
:was_run:
- :content: " pid = params[:id]"
:was_run: 0
- :content: " project = Project.find_by(id: pid)"
:was_run: 0
- :content: " #uid = Projects_user.where(:project_id => pid)"
:was_run:
- :content: " users = []"
:was_run: 0
- :content: ' projects_users = Projects_user.where("project_id = ?",pid).all'
:was_run: 0
- :content: " "
:was_run:
- :content: " projects_users.each do |projects_user|"
:was_run: 0
- :content: " uid = projects_user.user_id"
:was_run: 0
- :content: " i = User.find_by(id: uid)"
:was_run: 0
- :content: " users += [{"
:was_run: 0
- :content: " :name => i.name,"
:was_run:
- :content: " :id => i.id"
:was_run:
- :content: " }]"
:was_run:
- :content: " end"
:was_run:
- :content: " #puts users.inspect "
:was_run:
- :content: " # Users.find(uid).each do |i|"
:was_run:
- :content: " # users += [{"
:was_run:
- :content: " # :nickname => i.name,"
:was_run:
- :content: " # :id => i.id"
:was_run:
- :content: " # }]"
:was_run:
- :content: " # end"
:was_run:
- :content: " render :json => {"
:was_run: 0
- :content: " :code => 0,"
:was_run:
- :content: " :data => {"
:was_run:
- :content: " :name => project.name,"
:was_run:
- :content: " :content => project.content,"
:was_run:
- :content: " :users => users"
:was_run:
- :content: " }"
:was_run:
- :content: " }"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: !binary |-
ICAgICM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT0+6aG555uu5L+u5pS5
:was_run:
- :content: " def update"
:was_run: 1
- :content: " project = Project.find_by(:id => params[:project][:id])"
:was_run: 0
- :content: " if project.update(project_params)"
:was_run: 0
- :content: " render :json => {:code => 0}"
:was_run: 0
- :content: " else"
:was_run:
- :content: " render json:current_user.errors, status: :unprocessable_entity"
:was_run: 0
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " private"
:was_run: 1
- :content: " def project_params"
:was_run: 1
- :content: " params.require(:project).permit(:name,:content,:id)"
:was_run: 1
- :content: " end"
:was_run:
- :content: end
:was_run:
:percent_run: 21
:methods:
ProjectsController#index: 45.0
ProjectsController#create: 0.0
ProjectsController#addUsers: 14.285714285714285
ProjectsController#deleteUsers: 23.809523809523807
ProjectsController#detail: 58.333333333333336
ProjectsController#update: 0.0
ProjectsController#project_params: 0.0
"./app/controllers/sessions_controller.rb":
:lines:
- :content: class SessionsController < ApplicationController
:was_run: 1
- :content: !binary |-
ICAjIOmZpOeZu+W9leS5i+Wklu+8jOWFtuS9meaOpeWPo+W/hemhu+WcqOeZ
u+W9leeKtuaAgeS4i+iuv+mXrg==
:was_run:
- :content: " before_action :authenticate, except: [ :create ]"
:was_run: 1
- :content: " skip_before_action :verify_authenticity_token, :only => [:create,:destroy,:show]"
:was_run: 1
- :content: " "
:was_run:
- :content: !binary |-
ICAjIOeUqOaIt+eZu+W9lQ==
:was_run:
- :content: " "
:was_run:
- :content: " def create"
:was_run: 1
- :content: " user = User.find_by(email: params[:email])"
:was_run: 1
- :content: " if user && user.authenticate(params[:password])"
:was_run: 1
- :content: " session[:user_id] = user.id"
:was_run: 1
- :content: " render status: :ok, text: 'ok'"
:was_run: 1
- :content: " else"
:was_run:
- :content: " render status: :unauthorized, text: 'account or password is
not correct'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " def destroy"
:was_run: 1
- :content: " session.delete :user_id"
:was_run: 1
- :content: " @current_user &&= nil"
:was_run: 1
- :content: " render status: :ok, nothing: true"
:was_run: 1
- :content: " end"
:was_run:
- :content: " def show"
:was_run: 1
- :content: " render 'show'"
:was_run: 1
- :content: " end"
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods:
SessionsController#create: 0.0
SessionsController#destroy: 0.0
SessionsController#show: 0.0
"./app/controllers/shares_controller.rb":
:lines:
- :content: class SharesController < ApplicationController
:was_run: 1
- :content: " "
:was_run:
- :content: " before_action :authenticate"
:was_run: 1
- :content: " skip_before_action :verify_authenticity_token, :only => ["
:was_run: 1
- :content: " :create,"
:was_run:
- :content: " :getShareList"
:was_run:
- :content: " ]"
:was_run:
- :content: !binary |-
ICAgICPlvZPliY3nlKjmiLfliJvlu7rliIbkuqs=
:was_run:
- :content: " "
:was_run:
- :content: " def create"
:was_run: 1
- :content: " uid = session[:user_id].to_i"
:was_run: 1
- :content: " share=Share.new(share_params)"
:was_run: 1
- :content: " share.user_id=uid"
:was_run: 0
- :content: " if share.save"
:was_run: 0
- :content: !binary |-
ICAgICAgICAgICAgY29udGVudCA9ICI8YT4iK1VzZXIuZmluZCh1aWQpLm5h
bWUgKyAiPC9hPiDliIbkuqvkuobkuIDkupvkuosi
:was_run: 0
- :content: " pid=share.project_id"
:was_run: 0
- :content: " "
:was_run:
- :content: " Projects_user.where(:project_id => pid).each do |i|"
:was_run: 0
- :content: " params_note = {user_id: i.user_id,content: content,category:
1,project_id: pid}"
:was_run: 0
- :content: " note = Note.new(params_note)"
:was_run: 0
- :content: " note.save!"
:was_run: 0
- :content: " end"
:was_run:
- :content: " render status: :created, nothing: true"
:was_run: 0
- :content: " else"
:was_run:
- :content: " render json: project.errors, status: :unprocessable_entity"
:was_run: 0
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: !binary |-
ICAgICPojrflj5bpobnnm67nmoTliIbkuqvliJfooag=
:was_run:
- :content: " "
:was_run:
- :content: " def getShareList"
:was_run: 1
- :content: " #Todo"
:was_run:
- :content: " pid = params[:project_id]"
:was_run: 0
- :content: " "
:was_run:
- :content: " data = []"
:was_run: 0
- :content: ' Share.where(:project_id => pid).order("created_at desc").each
do |i|'
:was_run: 0
- :content: " puts i.content"
:was_run: 0
- :content: " name = User.find(i.user_id).name"
:was_run: 0
- :content: " data += [{"
:was_run: 0
- :content: " :name => name,"
:was_run:
- :content: " :time => i.created_at,"
:was_run:
- :content: " :content => i.content"
:was_run:
- :content: " }]"
:was_run:
- :content: " end"
:was_run:
- :content: " render :json => {"
:was_run: 0
- :content: " :code => 0,"
:was_run:
- :content: " :data => data"
:was_run:
- :content: " }"
:was_run:
- :content: " end"
:was_run:
- :content: " private"
:was_run: 1
- :content: " def share_params"
:was_run: 1
- :content: " params.require(:share).permit(:project_id,:content)"
:was_run: 1
- :content: " end"
:was_run:
- :content: end
:was_run:
:percent_run: 37
:methods:
SharesController#create: 0.0
SharesController#getShareList: 46.666666666666664
SharesController#share_params: 0.0
"./app/controllers/users_controller.rb":
:lines:
- :content: class UsersController < ApplicationController
:was_run: 1
- :content: " before_action :authenticate, except: [ :emailExist, :usernameExist,
:create ]"
:was_run: 1
- :content: " skip_before_action :verify_authenticity_token, :only => ["
:was_run: 1
- :content: " :emailExist,"
:was_run:
- :content: " :usernameExist,"
:was_run:
- :content: " :create,"
:was_run:
- :content: " :update"
:was_run:
- :content: " ]"
:was_run:
- :content: " def emailExist"
:was_run: 1
- :content: " if checkExist?(:email, params[:email])"
:was_run: 1
- :content: " render :text => '1'"
:was_run: 1
- :content: " else"
:was_run:
- :content: " render :text => '0'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " def usernameExist"
:was_run: 1
- :content: " if checkExist?(:name, params[:username])"
:was_run: 1
- :content: " render :text => 'exist'"
:was_run: 1
- :content: " else"
:was_run:
- :content: " render :text => 'not exist'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " def create"
:was_run: 1
- :content: " @user = User.new(user_params)"
:was_run: 1
- :content: " if @user.save"
:was_run: 1
- :content: " render status: :created, nothing: true"
:was_run: 1
- :content: " else"
:was_run:
- :content: " render json: @user.errors, status: :unprocessable_entity"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " def update"
:was_run: 1
- :content: " @user = current_user"
:was_run: 1
- :content: " if @user.update(user_params)"
:was_run: 1
- :content: " render 'show'"
:was_run: 1
- :content: " else"
:was_run:
- :content: " render json:current_user.errors, status: :unprocessable_entity"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " private"
:was_run: 1
- :content: " def checkExist?(field_name, value)"
:was_run: 1
- :content: " User.exists?(field_name => value)"
:was_run: 1
- :content: " end"
:was_run:
- :content: " def user_params"
:was_run: 1
- :content: " params.require(:user).permit(:name,:password, :password_confirmation,
:email, :phone)"
:was_run: 1
- :content: " end"
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods:
UsersController#emailExist: 0.0
UsersController#usernameExist: 0.0
UsersController#create: 0.0
UsersController#update: 0.0
UsersController#checkExist?: 0.0
UsersController#user_params: 0.0
"./app/models/comment.rb":
:lines:
- :content: class Comment < ActiveRecord::Base
:was_run: 1
- :content: " "
:was_run:
- :content: " belongs_to :mission"
:was_run: 1
- :content: " "
:was_run:
- :content: " validates :content, presence: true"
:was_run: 1
- :content: " validates :mission_id, presence: true"
:was_run: 1
- :content: " "
:was_run:
- :content: " validates :user_id, presence: true"
:was_run: 1
- :content: " validate :comment_has_atleast_one_character, on: :create"
:was_run: 1
- :content: " validate :user_id_exist, on: :create"
:was_run: 1
- :content: " "
:was_run:
- :content: " private "
:was_run: 1
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " def comment_has_atleast_one_character"
:was_run: 1
- :content: " tmp = content.strip"
:was_run: 1
- :content: " if tmp.length < 1"
:was_run: 1
- :content: " errors[:content] = 'content should has at least one
character'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " def user_id_exist"
:was_run: 1
- :content: " "
:was_run:
- :content: " user = User.find_by(id: user_id)"
:was_run: 1
- :content: " if user == nil"
:was_run: 1
- :content: ' errors[:user] = "user is not exist"'
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: !binary |-
ICAgICAgICAjIG1pc3Npb24g5piv5ZCm5a2Y5Zyo55qE6aqM6K+B5bCG5pS+
5ZyoY29udHJvbGxlcuS4rei/m+ihjA==
:was_run:
- :content: " "
:was_run:
- :content: " # def mission_id_should_be_exist"
:was_run:
- :content: " "
:was_run:
- :content: " # @mission = Mission.find(:mission_id)"
:was_run:
- :content: " "
:was_run:
- :content: " # if @mission == nil"
:was_run:
- :content: ' # errors[:mission_id] = "mission is not exist"'
:was_run:
- :content: " # end"
:was_run:
- :content: " # end "
:was_run:
- :content: " "
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods:
Comment#comment_has_atleast_one_character: 0.0
Comment#user_id_exist: 25.0
"./app/models/mission.rb":
:lines:
- :content: 'class Mission < ActiveRecord:: Base'
:was_run: 1
- :content: " has_many :comments"
:was_run: 1
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " validates :name, presence: true"
:was_run: 1
- :content: " validates :deadline, presence: true"
:was_run: 1
- :content: " validates :priority, presence: true"
:was_run: 1
- :content: " validates :status, presence: true"
:was_run: 1
- :content: " validates :content, presence: true"
:was_run: 1
- :content: " "
:was_run:
- :content: " validates :project_id, presence: true"
:was_run: 1
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " validate :priority_is_among_valid_values"
:was_run: 1
- :content: " validate :status_is_among_valid_values"
:was_run: 1
- :content: " "
:was_run:
- :content: " validate :project_exists, on: :create"
:was_run: 1
- :content: " "
:was_run:
- :content: " private "
:was_run: 1
- :content: " "
:was_run:
- :content: " def priority_is_among_valid_values"
:was_run: 1
- :content: " "
:was_run:
- :content: " if priority != 1 and priority != 2 and priority != 3"
:was_run: 1
- :content: ' errors[:priority] = "priority is not among valid
values"'
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " def status_is_among_valid_values"
:was_run: 1
- :content: " "
:was_run:
- :content: " if status != 1 and status != 2 and status != 3 and
status != 4"
:was_run: 1
- :content: ' errors[:status] = "status is not among valid values"'
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " def project_exists"
:was_run: 1
- :content: " #puts project_id"
:was_run:
- :content: " project = Project.find_by(id: project_id)"
:was_run: 1
- :content: " #puts project.inspect"
:was_run:
- :content: " if project == nil"
:was_run: 1
- :content: ' errors[:project_id] = "project_id is not exist"'
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods:
Mission#priority_is_among_valid_values: 33.33333333333333
Mission#status_is_among_valid_values: 33.33333333333333
Mission#project_exists: 40.0
"./app/models/missions_user.rb":
:lines:
- :content: 'class Missions_user <ActiveRecord:: Base'
:was_run: 1
- :content: " "
:was_run:
- :content: " validates :mission_id, presence: true"
:was_run: 1
- :content: " validates :user_id, presence: true"
:was_run: 1
- :content: " "
:was_run:
- :content: " validate :mission_exist, on: :create"
:was_run: 1
- :content: " validate :user_exist, on: :create"
:was_run: 1
- :content: " "
:was_run:
- :content: " private "
:was_run: 1
- :content: " def mission_exist"
:was_run: 1
- :content: " "
:was_run:
- :content: " mission = Mission.find_by(id: mission_id)"
:was_run: 1
- :content: " if mission == nil"
:was_run: 1
- :content: ' errors[:mission] = "mission belong to Missions_user
is not exist"'
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " def user_exist"
:was_run: 1
- :content: " "
:was_run:
- :content: " user = User.find_by(id: user_id)"
:was_run: 1
- :content: " if user == nil"
:was_run: 1
- :content: ' errors[:user] = "user belong to Missions_user is
not exist"'
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods:
Missions_user#mission_exist: 25.0
Missions_user#user_exist: 25.0
"./app/models/note.rb":
:lines:
- :content: 'class Note < ActiveRecord:: Base'
:was_run: 1
- :content: " "
:was_run:
- :content: " belongs_to :user"
:was_run: 1
- :content: " "
:was_run:
- :content: " validates :content, presence: true"
:was_run: 1
- :content: " validates :user_id, presence: true"
:was_run: 1
- :content: " validates :project_id, presence: true"
:was_run: 1
- :content: " validates :category, presence: true"
:was_run: 1
- :content: " "
:was_run:
- :content: " validate :note_has_atleast_one_character"
:was_run: 1
- :content: " validate :note_category_should_among_valid_values"
:was_run: 1
- :content: " validate :user_exist, on: :create"
:was_run: 1
- :content: " validate :project_exist, on: :create"
:was_run: 1
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " private "
:was_run: 1
- :content: " def note_has_atleast_one_character"
:was_run: 1
- :content: " tmp = content.strip"
:was_run: 1
- :content: " if tmp.length < 1"
:was_run: 1
- :content: ' errors[:content] = "note content should has at least
one character"'
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " def note_category_should_among_valid_values"
:was_run: 1
- :content: " "
:was_run:
- :content: " if category != 1 and category != 2 and category !=3"
:was_run: 1
- :content: ' errors[:category] = "note category is not among valid
values"'
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " def user_exist"
:was_run: 1
- :content: " "
:was_run:
- :content: " user = User.find_by(id: user_id)"
:was_run: 1
- :content: " if user == nil"
:was_run: 1
- :content: ' errors[:user] = "user belong to Note is not exist"'
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " def project_exist"
:was_run: 1
- :content: " "
:was_run:
- :content: " project = Project.find_by(id: project_id)"
:was_run: 1
- :content: " if project == nil"
:was_run: 1
- :content: ' errors[:project] = "project should be exist"'
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods:
Note#note_has_atleast_one_character: 0.0
Note#note_category_should_among_valid_values: 33.33333333333333
Note#user_exist: 25.0
Note#project_exist: 25.0
"./app/models/project.rb":
:lines:
- :content: class Project < ActiveRecord::Base
:was_run: 1
- :content: " has_and_belongs_to_many :users"
:was_run: 1
- :content: !binary |-
ICB2YWxpZGF0ZSA6cmVxdWlyZV9hdF9sZWFzdF9vbl91c2VyLG9uOiA6dXBk
YXRlICMg6aG555uu5Lit5pyA5bCR6KaB5pyJ5LiA5Liq55So5oi3
:was_run: 1
- :content: " "
:was_run:
- :content: " validates :name, presence: true, length: { minimum: 1, maximum:
50 }, uniqueness: true"
:was_run: 1
- :content: " private"
:was_run: 1
- :content: " def require_at_least_on_user"
:was_run: 1
- :content: !binary |-
ICAgICAgaWYgIXVzZXJzIHx8IHVzZXJzLnNpemUgPT0gMCAgIyDov5nph4zk
vb/nlKhzaXpl77yM5Y+v5Lul5pm66IO96YCJ5oup6ZyA5LiN6ZyA6KaB5p+l
6K+i5pWw5o2u5bqT
:was_run: 1
- :content: " errors[:users] = 'at least one user in the project'"
:was_run: 0
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: end
:was_run:
:percent_run: 88
:methods:
Project#require_at_least_on_user: 0.0
"./app/models/share.rb":
:lines:
- :content: class Share < ActiveRecord::Base
:was_run: 1
- :content: " "
:was_run:
- :content: " validates :content, presence: true"
:was_run: 1
- :content: " "
:was_run:
- :content: " validates :project_id, presence: true"
:was_run: 1
- :content: " "
:was_run:
- :content: " validates :user_id, presence: true"
:was_run: 1
- :content: " "
:was_run:
- :content: " validate :share_has_atleast_one_character "
:was_run: 1
- :content: " validate :user_exists,on: :create"
:was_run: 1
- :content: " validate :project_exists,on: :create"
:was_run: 1
- :content: " private "
:was_run: 1
- :content: " def share_has_atleast_one_character"
:was_run: 1
- :content: " tmp = content.strip"
:was_run: 1
- :content: " if tmp.length < 1"
:was_run: 1
- :content: ' errors[:content] = "share content should has at least
one character"'
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " def user_exists"
:was_run: 1
- :content: " "
:was_run:
- :content: " user = User.find_by(id: user_id)"
:was_run: 1
- :content: " if user == nil"
:was_run: 1
- :content: ' errors[:user] = "user belong to Share is not exist"'
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " def project_exists"
:was_run: 1
- :content: " "
:was_run:
- :content: " project = Project.find_by(id: project_id)"
:was_run: 1
- :content: " if project == nil"
:was_run: 1
- :content: ' errors[:project] = "user belong to Share is not exist"'
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " end "
:was_run:
- :content: " "
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods:
Share#share_has_atleast_one_character: 0.0
Share#user_exists: 25.0
Share#project_exists: 25.0
"./app/models/user.rb":
:lines:
- :content: class User < ActiveRecord::Base
:was_run: 1
- :content: " has_and_belongs_to_many :projects"
:was_run: 1
- :content: " has_and_belongs_to_many :missions"
:was_run: 1
- :content: " has_many :notes"
:was_run: 1
- :content: !binary |-
ICBoYXNfc2VjdXJlX3Bhc3N3b3JkICAjIOetieS7t+S6jumqjOivgXBhc3N3
b3JkX2NvbmZpcm3lkoxwYXNzd29yZOaYr+WQpuebuOetie+8jOW5tuS4lOmq
jOivgXBhc3N3b3Jk5piv5ZCm5a2Y5Zyo
:was_run: 1
- :content: " validates :name, presence: true, length: { maximum: 30 }"
:was_run: 1
- :content: " validates :email, presence: true, uniqueness: true, length: { maximum:
50},"
:was_run: 1
- :content: " format: { with: /\\A([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})\\Z/i
}"
:was_run:
- :content: " validates :password, length: { minimum: 6 },on:create"
:was_run: 1
- :content: " validates :phone, presence: true, format: { with: /\\A[0-9]{11,11}\\Z/i
},"
:was_run: 1
- :content: " multiline: false"
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods: {}
"./spec/controllers/notes_controller_spec.rb":
:lines:
- :content: require 'rails_helper'
:was_run: 1
- :content: 'RSpec.describe NotesController,type: :controller do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' describe "GET #getNotesList" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' it "return correct json format of noteslist" do'
:was_run: 1
- :content: " "
:was_run:
- :content: " register = create(:user)"
:was_run: 1
- :content: " user = User.find_by(email: register.email)"
:was_run: 1
- :content: " session[:user_id] = user.id "
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "project mission update test",content:
"update test"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << register"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params_note = {content: "note content 1",user_id: user.id,category:
2,project_id: project.id}'
:was_run: 1
- :content: " note = Note.new(params_note)"
:was_run: 1
- :content: " note.save"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params_note2 = {content: "note content 2",user_id: user.id,category:
1,project_id: project.id}'
:was_run: 1
- :content: " note2 = Note.new(params_note2)"
:was_run: 1
- :content: " note2.save"
:was_run: 1
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " post :getNotesList,project_id: project.id"
:was_run: 1
- :content: " puts response.body"
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: end
:was_run:
- :content: " "
:was_run:
:percent_run: 100
:methods: {}
"./spec/controllers/projects_controller_spec.rb":
:lines:
- :content: require 'rails_helper'
:was_run: 1
- :content: 'RSpec.describe ProjectsController, type: :controller do'
:was_run: 1
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: ' describe "GET #index " do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' it "return valid projects json" do'
:was_run: 1
- :content: " "
:was_run:
- :content: " register = create(:user)"
:was_run: 1
- :content: " user = User.find_by(email: register.email)"
:was_run: 1
- :content: " session[:user_id] = user.id "
:was_run: 1
- :content: " "
:was_run:
- :content: ' post :create,content: "project content 1",name: "project1"'
:was_run: 1
- :content: ' post :create,content: "project content 2", name: "project2"'
:was_run: 0
- :content: " "
:was_run:
- :content: " get :index"
:was_run: 0
- :content: " "
:was_run:
- :content: " puts response.body"
:was_run: 0
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' describe "POST #create" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' it "can create a valid project" do'
:was_run: 1
- :content: " "
:was_run:
- :content: " register = create(:user)"
:was_run: 1
- :content: " user = User.find_by(email: register.email)"
:was_run: 1
- :content: " #puts user.inspect"
:was_run:
- :content: " session[:user_id] = user.id "
:was_run: 1
- :content: ' post :create,content: "project content 1",name: "project1"'
:was_run: 1
- :content: " #puts response.body"
:was_run:
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' describe "POST #addUsers" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' it "can addUsers correctly" do'
:was_run: 1
- :content: " "
:was_run:
- :content: " register = create(:user)"
:was_run: 1
- :content: " user = User.find_by(email: register.email)"
:was_run: 1
- :content: " session[:user_id] = user.id "
:was_run: 1
- :content: " "
:was_run:
- :content: " #user1 = create(:user)"
:was_run:
- :content: " user2 = create(:user)"
:was_run: 1
- :content: ' params = {name: "project addUsers test",content: "addUsers
test"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << register"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: ' #post :create,content: "project content 3",name: "project3"'
:was_run:
- :content: " "
:was_run:
- :content: " post :addUsers,user_id: user2.id,project_id: project.id"
:was_run: 1
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' describe "GET #detail" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' it "can return correct json format of project " do'
:was_run: 1
- :content: " "
:was_run:
- :content: " register = create(:user)"
:was_run: 1
- :content: " user = User.find_by(email: register.email)"
:was_run: 1
- :content: " session[:user_id] = user.id "
:was_run: 1
- :content: " "
:was_run:
- :content: " user1 = create(:user)"
:was_run: 1
- :content: " user2 = create(:user)"
:was_run: 1
- :content: ' params = {name: "project addUsers test",content: "addUsers
test"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << register"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: " post :addUsers,user_id: user2.id,project_id: project.id"
:was_run: 1
- :content: " post :addUsers,user_id: user1.id,project_id: project.id"
:was_run: 0
- :content: " post :detail,id: project.id"
:was_run: 0
- :content: " puts response.body"
:was_run: 0
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: end
:was_run:
:percent_run: 86
:methods: {}
"./spec/controllers/sessions_controller_spec.rb":
:lines:
- :content: require 'rails_helper'
:was_run: 1
- :content: 'RSpec.describe SessionsController, type: :controller do'
:was_run: 1
- :content: " before :each do"
:was_run: 1
- :content: " @user1 = create(:user)"
:was_run: 1
- :content: " end"
:was_run:
- :content: " describe 'POST #create' do"
:was_run: 1
- :content: !binary |-
ICAgICMg5ZCI5rOV5rWB56iL5qCh6aqM
:was_run:
- :content: " context 'with legal account' do"
:was_run: 1
- :content: " before :each do"
:was_run: 1
- :content: " post :create, email: @user1.email, password: @user1.password"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should get correct email and password' do"
:was_run: 1
- :content: " actual_email = @user1.email"
:was_run: 1
- :content: " actual_password = @user1.password"
:was_run: 1
- :content: " expect(controller.params[:email]).to eq(actual_email)"
:was_run: 1
- :content: " expect(controller.params[:password]).to eq(actual_password)"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should authenticate success' do"
:was_run: 1
- :content: " expect(controller.session[:user_id]).to eq @user1.id"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should get ok and text: ok' do"
:was_run: 1
- :content: " expect(response).to have_http_status :ok"
:was_run: 1
- :content: " expect(response.body).to eq 'ok'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: !binary |-
ICAgICMg6Z2e5rOV5Y+C5pWw5rWL6K+V
:was_run:
- :content: " context 'with illegal account' do"
:was_run: 1
- :content: " before :each do"
:was_run: 1
- :content: " post :create, email: @user1.email, password: 'wrong_password'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'does not authenticate success' do"
:was_run: 1
- :content: " expect(controller.session[:user_id].nil?).to be true"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'return with 401' do"
:was_run: 1
- :content: " expect(response).to have_http_status :unauthorized"
:was_run: 1
- :content: " expect(response.body).to eq 'account or password is not correct'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should not raise error without param email or password'
do"
:was_run: 1
- :content: " expect {"
:was_run: 1
- :content: " post :create, email: @user1.email"
:was_run: 1
- :content: " }.not_to raise_error"
:was_run:
- :content: " expect {"
:was_run: 1
- :content: " post :create, password: 'wrong_password'"
:was_run: 1
- :content: " }.not_to raise_error"
:was_run:
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " describe 'DELETE #destroy' do"
:was_run: 1
- :content: " it 'should destroy user id in session' do"
:was_run: 1
- :content: " post :create, email:@user1.email, password: @user1.password"
:was_run: 1
- :content: " expect(controller.session[:user_id].nil?).to be false"
:was_run: 1
- :content: " delete :destroy"
:was_run: 1
- :content: " expect(controller.session[:user_id].nil?).to be true"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should return 401 without login' do"
:was_run: 1
- :content: " delete :destroy"
:was_run: 1
- :content: " expect(response).to have_http_status :unauthorized"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " describe 'GET #show' do"
:was_run: 1
- :content: " context 'after login' do"
:was_run: 1
- :content: " before :each do"
:was_run: 1
- :content: " post :create, email:@user1.email, password: @user1.password"
:was_run: 1
- :content: " get :show, format: 'json'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should render show template' do"
:was_run: 1
- :content: " expect(response).to render_template 'show'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should return user in json' do"
:was_run: 1
- :content: " userInfo = assigns[:current_user]"
:was_run: 1
- :content: " expect(userInfo.id).to eq @user1.id"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " it 'should renturn 401 without login' do"
:was_run: 1
- :content: " get :show, format: 'json'"
:was_run: 1
- :content: " expect(response).to have_http_status :unauthorized"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods: {}
"./spec/controllers/shares_controller_spec.rb":
:lines:
- :content: require 'rails_helper'
:was_run: 1
- :content: 'RSpec.describe SharesController,type: :controller do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' describe "POST #create" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' it "create a correct share" do'
:was_run: 1
- :content: " "
:was_run:
- :content: " register = create(:user)"
:was_run: 1
- :content: " user = User.find_by(email: register.email)"
:was_run: 1
- :content: " session[:user_id] = user.id "
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "project addUsers test",content: "addUsers
test"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << register"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: " "
:was_run:
- :content: !binary |-
ICAgICAgICAgICAgcG9zdCA6Y3JlYXRlLHByb2plY3RfaWQ6IHByb2plY3Qu
aWQsY29udGVudDogIuiLn+WIqeWbveWutueUn+atu+S7pe+8jOWyguWboOem
j+eluOmBv+i2i+S5iyI=
:was_run: 1
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' describe "GET #getShareList" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' it "return correct share list" do'
:was_run: 1
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " register = create(:user)"
:was_run: 1
- :content: " user = User.find_by(email: register.email)"
:was_run: 1
- :content: " session[:user_id] = user.id "
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "project test",content: " test"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << register"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: " "
:was_run:
- :content: !binary |-
ICAgICAgICAgICAgcG9zdCA6Y3JlYXRlLHByb2plY3RfaWQ6IHByb2plY3Qu
aWQsY29udGVudDogIuiLn+WIqeWbveWutueUn+atu+S7pe+8jOWyguWboOem
j+eluOmBv+i2i+S5iyI=
:was_run: 1
- :content: " "
:was_run:
- :content: ' post :create,project_id: project.id,content: "too young
too simple"'
:was_run: 0
- :content: " "
:was_run:
- :content: ' post :create,project_id: project.id,content: "too young
too naive"'
:was_run: 0
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " get :getShareList,project_id: project.id"
:was_run: 0
- :content: " "
:was_run:
- :content: " puts response.body"
:was_run: 0
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: end
:was_run:
:percent_run: 85
:methods: {}
"./spec/controllers/users_controller_spec.rb":
:lines:
- :content: require 'rails_helper'
:was_run: 1
- :content: 'RSpec.describe UsersController, type: :controller do'
:was_run: 1
- :content: " let(:user) { build(:user_with_sequence_number) }"
:was_run: 1
- :content: " let(:user_with_fixed_info){ create(:user)}"
:was_run: 1
- :content: " let(:valid_attributes){ attributes_for(:user) }"
:was_run: 1
- :content: " let(:invalid_attributes){ attributes_for(:user, email: nil, name:
'username2000') }"
:was_run: 1
- :content: " describe 'GET #emailExist' do"
:was_run: 1
- :content: " it 'valid email' do"
:was_run: 1
- :content: " get :emailExist, email: user.email"
:was_run: 1
- :content: " expect(response.body).to eq '0'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'duplicated email' do"
:was_run: 1
- :content: " user = create(:user_with_sequence_number)"
:was_run: 1
- :content: " get :emailExist, email: user.email"
:was_run: 1
- :content: " expect(response.body).to eq '1'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should not throw exception with no email param' do"
:was_run: 1
- :content: !binary |-
ICAgICAgZ2V0IDplbWFpbEV4aXN0ICAjIOS4jeS8muWksei0pe+8jOWImeiv
geaYjuayoeacieW8guW4uA==
:was_run: 1
- :content: " get :emailExist, other_param: 'test'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " describe 'GET #usernameExist' do"
:was_run: 1
- :content: " it 'valid username' do"
:was_run: 1
- :content: " get :usernameExist, username: user.name"
:was_run: 1
- :content: " expect(response.body).to eq 'not exist'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'duplicated username' do"
:was_run: 1
- :content: " user = create(:user_with_sequence_number)"
:was_run: 1
- :content: " get :usernameExist, username: user.name"
:was_run: 1
- :content: " expect(response.body).to eq 'exist'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should not throw exception with no username param' do"
:was_run: 1
- :content: " get :usernameExist"
:was_run: 1
- :content: " get :usernameExist, other_param: 'test'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " describe 'POST #create' do"
:was_run: 1
- :content: " context 'success with valid attributes' do"
:was_run: 1
- :content: " before :each do"
:was_run: 1
- :content: " post :create, user: valid_attributes"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should create user' do"
:was_run: 1
- :content: " expect(User.exists?(assigns[:user].id)).to be true"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should response with 201' do"
:was_run: 1
- :content: " expect(response).to have_http_status :created"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " context 'fail with invalid attributes' do"
:was_run: 1
- :content: !binary |-
ICAgICAgIyDlt7Lnu4/lnKhtb2RlbOa1i+ivleS4reWFheWIhumqjOivgeag
oeWvueadoeS7tu+8jOaJgOS7pei/memHjOWPquWvueS9v+eUqOeUteWtkOmC
rueuseS4uuepuueahOmdnuazleadoeS7tg==
:was_run:
- :content: " before :each do"
:was_run: 1
- :content: " post :create, user: invalid_attributes"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'does not save the new user' do"
:was_run: 1
- :content: " expect(User.exists? name: 'username2000').to be false"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should return errors' do"
:was_run: 1
- :content: " error_message = JSON.parse response.body"
:was_run: 1
- :content: " expect(error_message['email'].nil?).to be false"
:was_run: 1
- :content: " expect(error_message['email']).not_to be_empty"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " context 'deal with params more or less than required' do"
:was_run: 1
- :content: " let(:data_to_send) { { :name => 'username', :email => '1261138729@qq.com',"
:was_run: 1
- :content: " :password => 'secret', :password_confirmation
=> 'secret',"
:was_run:
- :content: " :more_field => 'test'} }"
:was_run: 1
- :content: " it 'should throw exception without param[:user]' do"
:was_run: 1
- :content: " expect {"
:was_run: 1
- :content: " post :create"
:was_run: 1
- :content: " }.to raise_error ActionController::ParameterMissing"
:was_run:
- :content: " end"
:was_run:
- :content: " it 'should not throw exception' do"
:was_run: 1
- :content: " expect {"
:was_run: 1
- :content: " post :create, user: data_to_send, other_param: 'test'"
:was_run: 1
- :content: " }.to_not raise_error"
:was_run:
- :content: " end"
:was_run:
- :content: " it 'should not accept other params' do"
:was_run: 1
- :content: " post :create, user: data_to_send"
:was_run: 1
- :content: " user = assigns(:user)"
:was_run: 1
- :content: " expect(user.has_attribute? :more_field).to eq false"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " describe 'PATCH #update' do"
:was_run: 1
- :content: " context 'with valid attributes' do"
:was_run: 1
- :content: " before :each do"
:was_run: 1
- :content: !binary |-
ICAgICAgICAjIOWBh+iuvuW3sue7j+eZu+W9leS6hg==
:was_run:
- :content: " allow(controller).to receive(:authenticate){ true }"
:was_run: 1
- :content: " allow(controller).to receive(:current_user).and_return(User.find
user_with_fixed_info.id)"
:was_run: 1
- :content: " patch :update, user: valid_attributes, format: 'json'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should located current user' do"
:was_run: 1
- :content: " expect(assigns[:user]).to eq user_with_fixed_info"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should render show' do"
:was_run: 1
- :content: " expect(response).to render_template 'show'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " context 'with invalid attributes' do"
:was_run: 1
- :content: " before :each do"
:was_run: 1
- :content: !binary |-
ICAgICAgICAjIOWBh+iuvuW3sue7j+eZu+W9leS6hg==
:was_run:
- :content: " allow(controller).to receive(:authenticate){ true }"
:was_run: 1
- :content: " allow(controller).to receive(:current_user).and_return(User.find
user_with_fixed_info.id)"
:was_run: 1
- :content: " patch :update, user: invalid_attributes, format: 'json'"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'does not change current user' do"
:was_run: 1
- :content: " expect(assigns[:user]).to eq user_with_fixed_info"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'should return error messages and error status' do"
:was_run: 1
- :content: " error_message = JSON.parse response.body"
:was_run: 1
- :content: " expect(error_message['email'].nil?).to be false"
:was_run: 1
- :content: " expect(error_message['email']).not_to be_empty"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " it 'should login first' do"
:was_run: 1
- :content: " patch :update, user:valid_attributes, format: 'json'"
:was_run: 1
- :content: " expect(response).to have_http_status :unauthorized"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods: {}
"./spec/models/comment_spec.rb":
:lines:
- :content: require 'rails_helper'
:was_run: 1
- :content: 'RSpec.describe Comment , type: :model do'
:was_run: 1
- :content: " "
:was_run:
- :content: " it 'has a valid comment' do"
:was_run: 1
- :content: ' params = {name: "jaxon",email: "370403444@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: ' params = {content:"good job",mission_id:123,user_id: user.id}'
:was_run: 1
- :content: " expect(Comment.new(params)).to be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' it "content should not be empty" do'
:was_run: 1
- :content: ' params = {name: "jaxon",email: "370403444@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: " params = {content: nil,mission_id: 123,user_id: user.id}"
:was_run: 1
- :content: " expect(Comment.new(params)).to_not be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' it "mission_id should not be empty" do'
:was_run: 1
- :content: ' params = {name: "jaxon",email: "370403444@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: ' params = {content:"good job", mission_id: nil,user_id: user.id}'
:was_run: 1
- :content: " expect(Comment.new(params)).to_not be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' it "content should has at least one word " do'
:was_run: 1
- :content: " comment_with_allspace = build(:comment_content_allspace)"
:was_run: 1
- :content: " comment_with_allspace.validate"
:was_run: 1
- :content: " expect(comment_with_allspace.errors[:content].size).to eq(1)"
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' it "user should be exist" do'
:was_run: 1
- :content: ' params = {name: "jaxon",email: "370403444@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: " expect(user).to be_valid"
:was_run: 1
- :content: ' params = {name: "project_1",content: "project content"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << user"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: " expect(project).to be_valid"
:was_run: 1
- :content: ' params = {name: "mission",deadline: "2016-10-17 10:00:00",priority:
1,status: 2,content: "mission content",project_id: project.id}'
:was_run: 1
- :content: " mission = Mission.new(params)"
:was_run: 1
- :content: " mission.save"
:was_run: 1
- :content: " expect(mission).to be_valid"
:was_run: 1
- :content: " expect(mission.errors[:project_id].size).to eq(0)"
:was_run: 1
- :content: ' params = {content: "comment", mission_id: mission.id, user_id:
user.id}'
:was_run: 1
- :content: " comment = Comment.new(params)"
:was_run: 1
- :content: " expect(comment).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods: {}
"./spec/models/mission_spec.rb":
:lines:
- :content: require 'rails_helper'
:was_run: 1
- :content: 'RSpec.describe Mission , type: :model do'
:was_run: 1
- :content: " "
:was_run:
- :content: " it 'has a valid mission' do"
:was_run: 1
- :content: !binary |-
ICAgICAgcGFyYW1zID0ge25hbWU6ICJtaXNzaW9uMSIsY29udGVudDogIm1p
c3Npb24gY29udGVudCIsZGVhZGxpbmU6IjIwMTYtMTAtMTcgMTA6MDA6MDAi
LHByaW9yaXR5OjEsc3RhdHVzOiLov5vooYzkuK0ifQ==
:was_run: 1
- :content: " "
:was_run:
- :content: " mission = Mission.new(params)"
:was_run: 1
- :content: " mission.validate"
:was_run: 1
- :content: " expect(mission).to be_valid "
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " it 'content should not be nil' do"
:was_run: 1
- :content: " expect(build(:no_content_mission)).to_not be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " it 'deadline should not be nil' do"
:was_run: 1
- :content: " expect(build(:no_deadline_mission)).to_not be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " it 'status should not be nil' do"
:was_run: 1
- :content: " expect(build(:no_status_mission)).to_not be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " it 'priority should not be nil' do"
:was_run: 1
- :content: " expect(build(:no_priority_mission)).to_not be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " it 'priority is not among valid values' do"
:was_run: 1
- :content: " mission = build(:priority_not_among_valid_values)"
:was_run: 1
- :content: " mission.validate"
:was_run: 1
- :content: " expect(mission.errors[:priority].size).to eq(1)"
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " it 'status is not among valid values' do"
:was_run: 1
- :content: " mission = build(:status_not_among_valid_values)"
:was_run: 1
- :content: " mission.validate"
:was_run: 1
- :content: " expect(mission.errors[:status].size).to eq(1)"
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: end
:was_run:
- :content: "# require 'rails_helper'"
:was_run:
- :content: "# RSpec.describe Mission, type: :model do"
:was_run:
- :content: "# it 'has a valid mission' do"
:was_run:
- :content: "# expect(build(:project)).to be_valid"
:was_run:
- :content: "# end"
:was_run:
- :content: "# describe 'users test' do"
:was_run:
- :content: "# it 'has at least on user' do"
:was_run:
- :content: "# mission_with_no_user = build(:mission)"
:was_run:
- :content: "# mission_with_no_user.users = []"
:was_run:
- :content: "# mission_with_no_user.valid?"
:was_run:
- :content: "# expect(mission_with_no_user.errors[:users].size).to eq(1)"
:was_run:
- :content: "# end"
:was_run:
- :content: "# end"
:was_run:
- :content: "# describe 'name test' do"
:was_run:
- :content: "# it 'does not allow absence of name' do"
:was_run:
- :content: "# expect(build(:mission, name: nil)).to_not be_valid"
:was_run:
- :content: "# end"
:was_run:
- :content: "# it 'length of name in [1,20]' do"
:was_run:
- :content: "# expect(build(:mission_name_length_gt_20)).to_not be_valid"
:was_run:
- :content: "# end"
:was_run:
- :content: "# end"
:was_run:
- :content: "# end"
:was_run:
:percent_run: 100
:methods: {}
"./spec/models/missions_user_spec.rb":
:lines:
- :content: require 'rails_helper'
:was_run: 1
- :content: 'RSpec.describe Missions_user , type: :model do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' it "mission should exist" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "jaxon",email: "370403444@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: " expect(user).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "project_1",content: "project content"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << user"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: " expect(project).to be_valid"
:was_run: 1
- :content: ' params = {name: "mission",deadline: "2016-10-17 10:00:00",priority:
1,status: 2,content: "mission content",project_id: project.id}'
:was_run: 1
- :content: " mission = Mission.new(params)"
:was_run: 1
- :content: " mission.save"
:was_run: 1
- :content: " expect(mission).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: " params = {mission_id: 5,user_id: user.id}"
:was_run: 1
- :content: " missions_user = Missions_user.new(params)"
:was_run: 1
- :content: " missions_user.save"
:was_run: 1
- :content: " expect(missions_user).to_not be_valid"
:was_run: 1
- :content: " expect(missions_user.errors[:mission].size).to eq(1)"
:was_run: 1
- :content: " expect(Missions_user.find_by(user_id: user.id)).to eq(nil)"
:was_run: 1
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' it "user should exist" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "jaxon",email: "370403444@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: " expect(user).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "project_1",content: "project content"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << user"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: " expect(project).to be_valid"
:was_run: 1
- :content: ' params = {name: "mission",deadline: "2016-10-17 10:00:00",priority:
1,status: 2,content: "mission content",project_id: project.id}'
:was_run: 1
- :content: " mission = Mission.new(params)"
:was_run: 1
- :content: " mission.save"
:was_run: 1
- :content: " expect(mission).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: " params = {mission_id: mission.id,user_id: 2}"
:was_run: 1
- :content: " missions_user = Missions_user.new(params)"
:was_run: 1
- :content: " missions_user.save"
:was_run: 1
- :content: " #puts missions_user.inspect"
:was_run:
- :content: " expect(missions_user).to_not be_valid"
:was_run: 1
- :content: " expect(missions_user.errors[:user].size).to eq(1)"
:was_run: 1
- :content: " expect(Missions_user.find_by(mission_id: mission.id)).to
eq(nil)"
:was_run: 1
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: " "
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods: {}
"./spec/models/note_spec.rb":
:lines:
- :content: require 'rails_helper'
:was_run: 1
- :content: 'RSpec.describe Note , type: :model do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' it "has a valid note" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "jaxon",email: "370403444@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "project_1",content: "project content"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << user"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: " expect(project).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {content: "note content",user_id: user.id,project_id:
project.id,category: 1}'
:was_run: 1
- :content: " note = Note.new(params)"
:was_run: 1
- :content: " note.save"
:was_run: 1
- :content: " expect(note).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' it "notes content should at least has one character" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "jaxon",email: "370403444@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {content: " ",user_id: user.id,category: 1}'
:was_run: 1
- :content: " note = Note.new(params)"
:was_run: 1
- :content: " note.save"
:was_run: 1
- :content: " expect(note.errors[:content].size).to eq(2)"
:was_run: 1
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' it "category should be among valid values" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "jaxon",email: "370403444@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: ' params = {content: " ",user_id: user.id,category: 4}'
:was_run: 1
- :content: " note = Note.new(params)"
:was_run: 1
- :content: " note.save"
:was_run: 1
- :content: " expect(note.errors[:category].size).to eq(1)"
:was_run: 1
- :content: " expect(note).to_not be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' it "notes user should be exist" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "jaxon",email: "370403444@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "project_1",content: "project content"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << user"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: " expect(project).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {content: "note content",user_id: user.id,project_id:
5,category: 1}'
:was_run: 1
- :content: " note = Note.new(params)"
:was_run: 1
- :content: " note.save"
:was_run: 1
- :content: " expect(note).to_not be_valid"
:was_run: 1
- :content: " expect(note.errors[:project].size).to eq(1)"
:was_run: 1
- :content: " expect(Note.find_by(project_id: 5)).to eq(nil)"
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' it "notes project should be exist" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "jaxon",email: "370403444@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "project_1",content: "project content"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << user"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: " expect(project).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {content: "note content",user_id: 5,project_id:
project.id,category: 1}'
:was_run: 1
- :content: " note = Note.new(params)"
:was_run: 1
- :content: " note.save"
:was_run: 1
- :content: " expect(note).to_not be_valid"
:was_run: 1
- :content: " expect(note.errors[:user].size).to eq(1)"
:was_run: 1
- :content: " expect(Note.find_by(user_id: 5)).to eq(nil)"
:was_run: 1
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods: {}
"./spec/models/project_spec.rb":
:lines:
- :content: require 'rails_helper'
:was_run: 1
- :content: 'RSpec.describe Project, type: :model do'
:was_run: 1
- :content: " it 'has a valid factory' do"
:was_run: 1
- :content: " expect(build(:project)).to be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " describe 'users test' do"
:was_run: 1
- :content: " it 'has at least on user' do"
:was_run: 1
- :content: " project_with_no_user = build(:project)"
:was_run: 1
- :content: " project_with_no_user.users = []"
:was_run: 1
- :content: " project_with_no_user.valid?"
:was_run: 1
- :content: " expect(project_with_no_user.errors[:users].size).to eq(1)"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " describe 'name test' do"
:was_run: 1
- :content: " it 'does not allow absence of name' do"
:was_run: 1
- :content: " expect(build(:project, name: nil)).to_not be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'length of name in [1,20]' do"
:was_run: 1
- :content: " expect(build(:project_name_length_gt_20)).to_not be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'does not allow duplicate name' do"
:was_run: 1
- :content: " create(:project, name: 'project1')"
:was_run: 1
- :content: " expect(build(:project, name: 'project1')).to_not be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods: {}
"./spec/models/share_spec.rb":
:lines:
- :content: require 'rails_helper'
:was_run: 1
- :content: 'RSpec.describe Share, type: :model do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' it "its a valid share" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "jaxon",email: "370403488@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: " expect(user).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "project_1",content: "project content"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << user"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: " expect(project).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {content: "share content",project_id: project.id,user_id:
user.id}'
:was_run: 1
- :content: " share = Share.new(params)"
:was_run: 1
- :content: " share.save"
:was_run: 1
- :content: " expect(share).to be_valid"
:was_run: 1
- :content: " expect(Share.find_by(id: share.id)).to_not eq(nil)"
:was_run: 1
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' it "share content should have at least one character" do'
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "jaxon",email: "370403444@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: " expect(user).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "project_1",content: "project content"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << user"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: " expect(project).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {content: " ",project_id: project.id,user_id:
user.id}'
:was_run: 1
- :content: " share = Share.new(params)"
:was_run: 1
- :content: " share.save"
:was_run: 1
- :content: " expect(share).to_not be_valid"
:was_run: 1
- :content: " expect(share.errors[:content].size).to eq(2)"
:was_run: 1
- :content: " expect(Share.find_by(id: share.id)).to eq(nil)"
:was_run: 1
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' it "share''s project should be exist" do'
:was_run: 1
- :content: ' params = {name: "jaxon",email: "370403444@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: " expect(user).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "project_1",content: "project content"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << user"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: " expect(project).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {content: "share content",project_id: 5,user_id:
user.id}'
:was_run: 1
- :content: " share = Share.new(params)"
:was_run: 1
- :content: " share.save"
:was_run: 1
- :content: " expect(share).to_not be_valid"
:was_run: 1
- :content: " expect(share.errors[:project].size).to eq(1)"
:was_run: 1
- :content: " expect(Share.find_by(id: share.id)).to eq(nil)"
:was_run: 1
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: ' it "share''s user should be exist" do'
:was_run: 1
- :content: ' params = {name: "jaxon",email: "370403444@qq.com",password_digest:
"123456",phone: "15652336366"}'
:was_run: 1
- :content: " user = User.new(params)"
:was_run: 1
- :content: " user.save"
:was_run: 1
- :content: " expect(user).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {name: "project_1",content: "project content"}'
:was_run: 1
- :content: " project = Project.new(params)"
:was_run: 1
- :content: " project.users << user"
:was_run: 1
- :content: " project.save"
:was_run: 1
- :content: " expect(project).to be_valid"
:was_run: 1
- :content: " "
:was_run:
- :content: ' params = {content: "share content",project_id: project.id,user_id:
10}'
:was_run: 1
- :content: " share = Share.new(params)"
:was_run: 1
- :content: " share.save"
:was_run: 1
- :content: " expect(share).to_not be_valid"
:was_run: 1
- :content: " expect(share.errors[:user].size).to eq(1)"
:was_run: 1
- :content: " expect(Share.find_by(id: share.id)).to eq(nil)"
:was_run: 1
- :content: " "
:was_run:
- :content: " end"
:was_run:
- :content: " "
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods: {}
"./spec/models/user_spec.rb":
:lines:
- :content: require 'rails_helper'
:was_run: 1
- :content: 'RSpec.describe User, type: :model do'
:was_run: 1
- :content: " it 'has a valid factory' do"
:was_run: 1
- :content: " expect(build(:user)).to be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " describe 'username test' do"
:was_run: 1
- :content: " it 'does not allow absence of username' do"
:was_run: 1
- :content: " expect(build(:user, name: nil)).not_to be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'does not allow name length > 30' do"
:was_run: 1
- :content: " expect(build(:user_name_length_gt_30)).not_to be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " describe 'email test' do"
:was_run: 1
- :content: " it 'does not allow absence of email' do"
:was_run: 1
- :content: " expect(build(:user, email: nil)).not_to be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'does not allow email length > 50' do"
:was_run: 1
- :content: " expect(build(:user_email_length_gt_50)).not_to be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'email should match /\\A([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})\\Z/i'
do"
:was_run: 1
- :content: " expect(build(:user, email: '123qq.com')).not_to be_valid"
:was_run: 1
- :content: " expect(build(:user, email: '@qq.com')).not_to be_valid"
:was_run: 1
- :content: " expect(build(:user, email: '123@qq')).not_to be_valid"
:was_run: 1
- :content: " expect(build(:user, email: '123@.com')).not_to be_valid"
:was_run: 1
- :content: " expect(build(:user, email: '123@qq.')).not_to be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " describe 'password test' do"
:was_run: 1
- :content: " it 'does not allow password length < 6' do"
:was_run: 1
- :content: " expect(build(:user_password_length_lt_6)).not_to be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'password_confirmation should match password when password_confirmation
not nil' do"
:was_run: 1
- :content: " expect(build(:user, password: '123456', password_confirmation:
'654321')).to_not be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'do not trigger match when password_confirmation nil' do"
:was_run: 1
- :content: " expect(build(:user, password: '123456', password_confirmation:
nil)).to be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'does not allow password absence on create' do"
:was_run: 1
- :content: " expect(build(:user, password: nil, password_confirmation: nil)).to_not
be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'can authenticate' do"
:was_run: 1
- :content: " user = create(:user, password: '123456', password_confirmation:
'123456')"
:was_run: 1
- :content: " expect(user.authenticate('123456')).to be_instance_of User"
:was_run: 1
- :content: " expect(user.authenticate('654312')).to be false"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: " describe 'phone test' do"
:was_run: 1
- :content: " it 'does not allow phone absence' do"
:was_run: 1
- :content: " expect(build(:user, phone: nil)).to_not be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'does not allow character other than number' do"
:was_run: 1
- :content: " expect(build(:user, phone: '1371234567a')).to_not be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " it 'does not allow phone longer or shorter than 11' do"
:was_run: 1
- :content: " expect(build(:user, phone: '137123456789')).to_not be_valid"
:was_run: 1
- :content: " expect(build(:user, phone: '1371234567')).to_not be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: !binary |-
ICAgICMg6ZiyanPms6jlhaU=
:was_run:
- :content: " it 'does not allow multiline' do"
:was_run: 1
- :content: " expect(build(:user, phone: '13712345\\n78')).to_not be_valid"
:was_run: 1
- :content: " end"
:was_run:
- :content: " end"
:was_run:
- :content: end
:was_run:
:percent_run: 100
:methods: {}
:global_percent_run: 87.1
:hotspots:
files:
- location:
class_name:
method_name:
file_path: "./app/controllers/notes_controller.rb"
file_name: "./app/controllers/notes_controller.rb"
line_number:
hash_key: '["./app/controllers/notes_controller.rb", nil, nil]'
details:
rcov: uncovered code is 44.0%
- location:
class_name:
method_name:
file_path: "./app/models/mission.rb"
file_name: "./app/models/mission.rb"
line_number:
hash_key: '["./app/models/mission.rb", nil, nil]'
details:
saikuro: average complexity is 2.0
rcov: average uncovered code is 35.6%
- location:
class_name:
method_name:
file_path: "./app/controllers/missions_controller.rb"
file_name: "./app/controllers/missions_controller.rb"
line_number:
hash_key: '["./app/controllers/missions_controller.rb", nil, nil]'
details:
rcov: average uncovered code is 35.2%
- location:
class_name:
method_name:
file_path: "./app/models/missions_user.rb"
file_name: "./app/models/missions_user.rb"
line_number:
hash_key: '["./app/models/missions_user.rb", nil, nil]'
details:
rcov: average uncovered code is 25.0%
- location:
class_name:
method_name:
file_path: "./app/models/note.rb"
file_name: "./app/models/note.rb"
line_number:
hash_key: '["./app/models/note.rb", nil, nil]'
details:
saikuro: average complexity is 2.0
rcov: average uncovered code is 20.8%
- location:
class_name:
method_name:
file_path: "./app/controllers/projects_controller.rb"
file_name: "./app/controllers/projects_controller.rb"
line_number:
hash_key: '["./app/controllers/projects_controller.rb", nil, nil]'
details:
saikuro: average complexity is 1.7
rcov: average uncovered code is 20.2%
- location:
class_name:
method_name:
file_path: "./app/models/share.rb"
file_name: "./app/models/share.rb"
line_number:
hash_key: '["./app/models/share.rb", nil, nil]'
details:
saikuro: complexity is 2.0
rcov: average uncovered code is 16.7%
- location:
class_name:
method_name:
file_path: "./app/controllers/shares_controller.rb"
file_name: "./app/controllers/shares_controller.rb"
line_number:
hash_key: '["./app/controllers/shares_controller.rb", nil, nil]'
details:
saikuro: complexity is 1.0
rcov: average uncovered code is 15.6%
- location:
class_name:
method_name:
file_path: "./app/models/comment.rb"
file_name: "./app/models/comment.rb"
line_number:
hash_key: '["./app/models/comment.rb", nil, nil]'
details:
saikuro: complexity is 2.0
rcov: average uncovered code is 12.5%
- location:
class_name:
method_name:
file_path: app/controllers/notes_controller.rb
file_name: app/controllers/notes_controller.rb
line_number:
hash_key: '["app/controllers/notes_controller.rb", nil, nil]'
details:
saikuro: complexity is 4.0
roodi: found 2 design problems
reek: found 10 code smells
- location:
class_name:
method_name:
file_path: app/controllers/projects_controller.rb
file_name: app/controllers/projects_controller.rb
line_number:
hash_key: '["app/controllers/projects_controller.rb", nil, nil]'
details:
flay: found 1 code duplications
churn: detected high level of churn (changed 16 times)
saikuro: average complexity is 2.0
roodi: found 3 design problems
reek: found 12 code smells
- location:
class_name:
method_name:
file_path: app/controllers/missions_controller.rb
file_name: app/controllers/missions_controller.rb
line_number:
hash_key: '["app/controllers/missions_controller.rb", nil, nil]'
details:
saikuro: average complexity is 2.4
roodi: found 4 design problems
reek: found 11 code smells
- location:
class_name:
method_name:
file_path: app/models/missions_user.rb
file_name: app/models/missions_user.rb
line_number:
hash_key: '["app/models/missions_user.rb", nil, nil]'
details:
flay: found 1 code duplications
saikuro: average complexity is 2.0
roodi: found 1 design problems
reek: found 3 code smells
- location:
class_name:
method_name:
file_path: app/models/note.rb
file_name: app/models/note.rb
line_number:
hash_key: '["app/models/note.rb", nil, nil]'
details:
flay: found 2 code duplications
saikuro: average complexity is 2.0
reek: found 3 code smells
- location:
class_name:
method_name:
file_path: app/controllers/shares_controller.rb
file_name: app/controllers/shares_controller.rb
line_number:
hash_key: '["app/controllers/shares_controller.rb", nil, nil]'
details:
saikuro: average complexity is 2.5
roodi: found 1 design problems
reek: found 8 code smells
- location:
class_name:
method_name:
file_path: app/models/mission.rb
file_name: app/models/mission.rb
line_number:
hash_key: '["app/models/mission.rb", nil, nil]'
details:
flay: found 2 code duplications
saikuro: complexity is 2.0
reek: found 2 code smells
- location:
class_name:
method_name:
file_path: app/models/projects_user.rb
file_name: app/models/projects_user.rb
line_number:
hash_key: '["app/models/projects_user.rb", nil, nil]'
details:
flay: found 1 code duplications
saikuro: average complexity is 2.0
roodi: found 1 design problems
reek: found 3 code smells
- location:
class_name:
method_name:
file_path: app/controllers/users_controller.rb
file_name: app/controllers/users_controller.rb
line_number:
hash_key: '["app/controllers/users_controller.rb", nil, nil]'
details:
flay: found 1 code duplications
saikuro: average complexity is 1.7
roodi: found 3 design problems
reek: found 5 code smells
- location:
class_name:
method_name:
file_path: app/models/comment.rb
file_name: app/models/comment.rb
line_number:
hash_key: '["app/models/comment.rb", nil, nil]'
details:
flay: found 1 code duplications
saikuro: complexity is 2.0
reek: found 1 code smells
- location:
class_name:
method_name:
file_path: app/models/share.rb
file_name: app/models/share.rb
line_number:
hash_key: '["app/models/share.rb", nil, nil]'
details:
flay: found 1 code duplications
saikuro: average complexity is 2.0
reek: found 3 code smells
- location:
class_name:
method_name:
file_path: app/controllers/application_controller.rb
file_name: app/controllers/application_controller.rb
line_number:
hash_key: '["app/controllers/application_controller.rb", nil, nil]'
details:
saikuro: complexity is 2.0
reek: found 2 code smells
- location:
class_name:
method_name:
file_path: "./app/controllers/application_controller.rb"
file_name: "./app/controllers/application_controller.rb"
line_number:
hash_key: '["./app/controllers/application_controller.rb", nil, nil]'
details:
saikuro: complexity is 2.0
rcov: average uncovered code is 0.0%
- location:
class_name:
method_name:
file_path: "./app/models/project.rb"
file_name: "./app/models/project.rb"
line_number:
hash_key: '["./app/models/project.rb", nil, nil]'
details:
saikuro: complexity is 2.0
rcov: uncovered code is 0.0%
- location:
class_name:
method_name:
file_path: "./app/controllers/users_controller.rb"
file_name: "./app/controllers/users_controller.rb"
line_number:
hash_key: '["./app/controllers/users_controller.rb", nil, nil]'
details:
saikuro: average complexity is 1.7
rcov: average uncovered code is 0.0%
- location:
class_name:
method_name:
file_path: "./app/controllers/sessions_controller.rb"
file_name: "./app/controllers/sessions_controller.rb"
line_number:
hash_key: '["./app/controllers/sessions_controller.rb", nil, nil]'
details:
saikuro: average complexity is 1.3
rcov: average uncovered code is 0.0%
- location:
class_name:
method_name:
file_path: db/schema.rb
file_name: db/schema.rb
line_number:
hash_key: '["db/schema.rb", nil, nil]'
details:
churn: detected high level of churn (changed 12 times)
- location:
class_name:
method_name:
file_path: app/models/project.rb
file_name: app/models/project.rb
line_number:
hash_key: '["app/models/project.rb", nil, nil]'
details:
reek: found 1 code smells
- location:
class_name:
method_name:
file_path: app/controllers/sessions_controller.rb
file_name: app/controllers/sessions_controller.rb
line_number:
hash_key: '["app/controllers/sessions_controller.rb", nil, nil]'
details:
reek: found 1 code smells
- location:
class_name:
method_name:
file_path: app/models/user.rb
file_name: app/models/user.rb
line_number:
hash_key: '["app/models/user.rb", nil, nil]'
details:
reek: found 1 code smells
classes:
- location:
class_name: NotesController
method_name:
file_path: app/controllers/notes_controller.rb
file_name: app/controllers/notes_controller.rb
line_number:
hash_key: '["app/controllers/notes_controller.rb", "NotesController", nil]'
details:
saikuro: complexity is 4.0
reek: found 10 code smells
rcov: uncovered code is 44.0%
- location:
class_name: MissionsController
method_name:
file_path: app/controllers/missions_controller.rb
file_name: app/controllers/missions_controller.rb
line_number:
hash_key: '["app/controllers/missions_controller.rb", "MissionsController",
nil]'
details:
saikuro: average complexity is 2.4
reek: found 11 code smells
rcov: average uncovered code is 35.2%
- location:
class_name: Mission
method_name:
file_path: app/models/mission.rb
file_name: app/models/mission.rb
line_number:
hash_key: '["app/models/mission.rb", "Mission", nil]'
details:
saikuro: average complexity is 2.0
reek: found 2 code smells
rcov: average uncovered code is 35.6%
- location:
class_name: Missions_user
method_name:
file_path: app/models/missions_user.rb
file_name: app/models/missions_user.rb
line_number:
hash_key: '["app/models/missions_user.rb", "Missions_user", nil]'
details:
saikuro: average complexity is 2.0
reek: found 3 code smells
rcov: average uncovered code is 25.0%
- location:
class_name: Note
method_name:
file_path: app/models/note.rb
file_name: app/models/note.rb
line_number:
hash_key: '["app/models/note.rb", "Note", nil]'
details:
saikuro: average complexity is 2.0
reek: found 3 code smells
rcov: average uncovered code is 20.8%
- location:
class_name: ProjectsController
method_name:
file_path: "./app/controllers/projects_controller.rb"
file_name: "./app/controllers/projects_controller.rb"
line_number:
hash_key: '["./app/controllers/projects_controller.rb", "ProjectsController",
nil]'
details:
saikuro: average complexity is 1.9
reek: found 12 code smells
rcov: average uncovered code is 20.2%
- location:
class_name: Share
method_name:
file_path: app/models/share.rb
file_name: app/models/share.rb
line_number:
hash_key: '["app/models/share.rb", "Share", nil]'
details:
saikuro: average complexity is 2.0
reek: found 3 code smells
rcov: average uncovered code is 16.7%
- location:
class_name: SharesController
method_name:
file_path: app/controllers/shares_controller.rb
file_name: app/controllers/shares_controller.rb
line_number:
hash_key: '["app/controllers/shares_controller.rb", "SharesController", nil]'
details:
saikuro: average complexity is 2.0
reek: found 8 code smells
rcov: average uncovered code is 15.6%
- location:
class_name: Comment
method_name:
file_path: app/models/comment.rb
file_name: app/models/comment.rb
line_number:
hash_key: '["app/models/comment.rb", "Comment", nil]'
details:
saikuro: average complexity is 2.0
reek: found 1 code smells
rcov: average uncovered code is 12.5%
- location:
class_name: Projects_user
method_name:
file_path: app/models/projects_user.rb
file_name: app/models/projects_user.rb
line_number:
hash_key: '["app/models/projects_user.rb", "Projects_user", nil]'
details:
saikuro: average complexity is 2.0
reek: found 3 code smells
- location:
class_name: UsersController
method_name:
file_path: "./app/controllers/users_controller.rb"
file_name: "./app/controllers/users_controller.rb"
line_number:
hash_key: '["./app/controllers/users_controller.rb", "UsersController", nil]'
details:
saikuro: average complexity is 1.7
reek: found 5 code smells
rcov: average uncovered code is 0.0%
- location:
class_name: ApplicationController
method_name:
file_path: app/controllers/application_controller.rb
file_name: app/controllers/application_controller.rb
line_number:
hash_key: '["app/controllers/application_controller.rb", "ApplicationController",
nil]'
details:
saikuro: average complexity is 2.0
reek: found 2 code smells
rcov: average uncovered code is 0.0%
- location:
class_name: Project
method_name:
file_path: "./app/models/project.rb"
file_name: "./app/models/project.rb"
line_number:
hash_key: '["./app/models/project.rb", "Project", nil]'
details:
saikuro: complexity is 2.0
reek: found 1 code smells
rcov: uncovered code is 0.0%
- location:
class_name: SessionsController
method_name:
file_path: "./app/controllers/sessions_controller.rb"
file_name: "./app/controllers/sessions_controller.rb"
line_number:
hash_key: '["./app/controllers/sessions_controller.rb", "SessionsController",
nil]'
details:
saikuro: average complexity is 1.3
reek: found 1 code smells
rcov: average uncovered code is 0.0%
- location:
class_name: User
method_name:
file_path: app/models/user.rb
file_name: app/models/user.rb
line_number:
hash_key: '["app/models/user.rb", "User", nil]'
details:
reek: found 1 code smells
methods:
- location:
class_name: MissionsController
method_name: MissionsController#getlist
file_path: app/controllers/missions_controller.rb
file_name: app/controllers/missions_controller.rb
line_number:
hash_key: '["app/controllers/missions_controller.rb", "MissionsController",
"MissionsController#getlist"]'
simple_method_name: "#getlist"
details:
saikuro: complexity is 2.0
reek: found 1 code smells
rcov: uncovered code is 71.4%
- location:
class_name: ProjectsController
method_name: ProjectsController#detail
file_path: app/controllers/projects_controller.rb
file_name: app/controllers/projects_controller.rb
line_number:
hash_key: '["app/controllers/projects_controller.rb", "ProjectsController",
"ProjectsController#detail"]'
simple_method_name: "#detail"
details:
saikuro: complexity is 2.0
reek: found 2 code smells
rcov: uncovered code is 58.3%
- location:
class_name: SharesController
method_name: SharesController#getShareList
file_path: app/controllers/shares_controller.rb
file_name: app/controllers/shares_controller.rb
line_number:
hash_key: '["app/controllers/shares_controller.rb", "SharesController", "SharesController#getShareList"]'
simple_method_name: "#getShareList"
details:
saikuro: complexity is 2.0
reek: found 5 code smells
rcov: uncovered code is 46.7%
- location:
class_name: NotesController
method_name: NotesController#getNotesList
file_path: app/controllers/notes_controller.rb
file_name: app/controllers/notes_controller.rb
line_number:
hash_key: '["app/controllers/notes_controller.rb", "NotesController", "NotesController#getNotesList"]'
simple_method_name: "#getNotesList"
details:
saikuro: complexity is 4.0
reek: found 9 code smells
rcov: uncovered code is 44.0%
- location:
class_name: ProjectsController
method_name: ProjectsController#index
file_path: app/controllers/projects_controller.rb
file_name: app/controllers/projects_controller.rb
line_number:
hash_key: '["app/controllers/projects_controller.rb", "ProjectsController",
"ProjectsController#index"]'
simple_method_name: "#index"
details:
saikuro: complexity is 2.0
reek: found 3 code smells
rcov: uncovered code is 45.0%
- location:
class_name: MissionsController
method_name: MissionsController#detail
file_path: app/controllers/missions_controller.rb
file_name: app/controllers/missions_controller.rb
line_number:
hash_key: '["app/controllers/missions_controller.rb", "MissionsController",
"MissionsController#detail"]'
simple_method_name: "#detail"
details:
saikuro: complexity is 3.0
reek: found 3 code smells
rcov: uncovered code is 40.0%
- location:
class_name: Mission
method_name: Mission#project_exists
file_path: app/models/mission.rb
file_name: app/models/mission.rb
line_number:
hash_key: '["app/models/mission.rb", "Mission", "Mission#project_exists"]'
simple_method_name: "#project_exists"
details:
saikuro: complexity is 2.0
reek: found 1 code smells
rcov: uncovered code is 40.0%
- location:
class_name: Note
method_name: Note#note_category_should_among_valid_values
file_path: "./app/models/note.rb"
file_name: "./app/models/note.rb"
line_number:
hash_key: '["./app/models/note.rb", "Note", "Note#note_category_should_among_valid_values"]'
simple_method_name: "#note_category_should_among_valid_values"
details:
saikuro: complexity is 2.0
rcov: uncovered code is 33.3%
- location:
class_name: Mission
method_name: Mission#status_is_among_valid_values
file_path: "./app/models/mission.rb"
file_name: "./app/models/mission.rb"
line_number:
hash_key: '["./app/models/mission.rb", "Mission", "Mission#status_is_among_valid_values"]'
simple_method_name: "#status_is_among_valid_values"
details:
saikuro: complexity is 2.0
rcov: uncovered code is 33.3%
- location:
class_name: Mission
method_name: Mission#priority_is_among_valid_values
file_path: "./app/models/mission.rb"
file_name: "./app/models/mission.rb"
line_number:
hash_key: '["./app/models/mission.rb", "Mission", "Mission#priority_is_among_valid_values"]'
simple_method_name: "#priority_is_among_valid_values"
details:
saikuro: complexity is 2.0
rcov: uncovered code is 33.3%
- location:
class_name: MissionsController
method_name: MissionsController#create
file_path: app/controllers/missions_controller.rb
file_name: app/controllers/missions_controller.rb
line_number:
hash_key: '["app/controllers/missions_controller.rb", "MissionsController",
"MissionsController#create"]'
simple_method_name: "#create"
details:
saikuro: complexity is 3.0
reek: found 2 code smells
rcov: uncovered code is 27.3%
- location:
class_name: MissionsController
method_name: MissionsController#update
file_path: app/controllers/missions_controller.rb
file_name: app/controllers/missions_controller.rb
line_number:
hash_key: '["app/controllers/missions_controller.rb", "MissionsController",
"MissionsController#update"]'
simple_method_name: "#update"
details:
saikuro: complexity is 2.0
reek: found 2 code smells
rcov: uncovered code is 25.0%
- location:
class_name: Comment
method_name: Comment#user_id_exist
file_path: app/models/comment.rb
file_name: app/models/comment.rb
line_number:
hash_key: '["app/models/comment.rb", "Comment", "Comment#user_id_exist"]'
simple_method_name: "#user_id_exist"
details:
saikuro: complexity is 2.0
reek: found 1 code smells
rcov: uncovered code is 25.0%
- location:
class_name: Missions_user
method_name: Missions_user#mission_exist
file_path: app/models/missions_user.rb
file_name: app/models/missions_user.rb
line_number:
hash_key: '["app/models/missions_user.rb", "Missions_user", "Missions_user#mission_exist"]'
simple_method_name: "#mission_exist"
details:
saikuro: complexity is 2.0
reek: found 1 code smells
rcov: uncovered code is 25.0%
- location:
class_name: Missions_user
method_name: Missions_user#user_exist
file_path: app/models/missions_user.rb
file_name: app/models/missions_user.rb
line_number:
hash_key: '["app/models/missions_user.rb", "Missions_user", "Missions_user#user_exist"]'
simple_method_name: "#user_exist"
details:
saikuro: complexity is 2.0
reek: found 1 code smells
rcov: uncovered code is 25.0%
- location:
class_name: Note
method_name: Note#project_exist
file_path: app/models/note.rb
file_name: app/models/note.rb
line_number:
hash_key: '["app/models/note.rb", "Note", "Note#project_exist"]'
simple_method_name: "#project_exist"
details:
saikuro: complexity is 2.0
reek: found 1 code smells
rcov: uncovered code is 25.0%
- location:
class_name: Note
method_name: Note#user_exist
file_path: app/models/note.rb
file_name: app/models/note.rb
line_number:
hash_key: '["app/models/note.rb", "Note", "Note#user_exist"]'
simple_method_name: "#user_exist"
details:
saikuro: complexity is 2.0
reek: found 1 code smells
rcov: uncovered code is 25.0%
- location:
class_name: Share
method_name: Share#project_exists
file_path: app/models/share.rb
file_name: app/models/share.rb
line_number:
hash_key: '["app/models/share.rb", "Share", "Share#project_exists"]'
simple_method_name: "#project_exists"
details:
saikuro: complexity is 2.0
reek: found 1 code smells
rcov: uncovered code is 25.0%
- location:
class_name: Share
method_name: Share#user_exists
file_path: app/models/share.rb
file_name: app/models/share.rb
line_number:
hash_key: '["app/models/share.rb", "Share", "Share#user_exists"]'
simple_method_name: "#user_exists"
details:
saikuro: complexity is 2.0
reek: found 1 code smells
rcov: uncovered code is 25.0%
- location:
class_name: ProjectsController
method_name: ProjectsController#deleteUsers
file_path: app/controllers/projects_controller.rb
file_name: app/controllers/projects_controller.rb
line_number:
hash_key: '["app/controllers/projects_controller.rb", "ProjectsController",
"ProjectsController#deleteUsers"]'
simple_method_name: "#deleteUsers"
details:
saikuro: complexity is 2.0
reek: found 3 code smells
rcov: uncovered code is 23.8%
- location:
class_name: ProjectsController
method_name: ProjectsController#addUsers
file_path: app/controllers/projects_controller.rb
file_name: app/controllers/projects_controller.rb
line_number:
hash_key: '["app/controllers/projects_controller.rb", "ProjectsController",
"ProjectsController#addUsers"]'
simple_method_name: "#addUsers"
details:
saikuro: complexity is 2.0
reek: found 3 code smells
rcov: uncovered code is 14.3%
- location:
class_name: MissionsController
method_name: MissionsController#commentPublish
file_path: app/controllers/missions_controller.rb
file_name: app/controllers/missions_controller.rb
line_number:
hash_key: '["app/controllers/missions_controller.rb", "MissionsController",
"MissionsController#commentPublish"]'
simple_method_name: "#commentPublish"
details:
saikuro: complexity is 2.0
reek: found 2 code smells
rcov: uncovered code is 12.5%
- location:
class_name: SharesController
method_name: SharesController#create
file_path: app/controllers/shares_controller.rb
file_name: app/controllers/shares_controller.rb
line_number:
hash_key: '["app/controllers/shares_controller.rb", "SharesController", "SharesController#create"]'
simple_method_name: "#create"
details:
saikuro: complexity is 3.0
reek: found 2 code smells
rcov: uncovered code is 0.0%
- location:
class_name: ApplicationController
method_name: ApplicationController#current_user
file_path: app/controllers/application_controller.rb
file_name: app/controllers/application_controller.rb
line_number:
hash_key: '["app/controllers/application_controller.rb", "ApplicationController",
"ApplicationController#current_user"]'
simple_method_name: "#current_user"
details:
saikuro: complexity is 2.0
reek: found 1 code smells
rcov: uncovered code is 0.0%
- location:
class_name: Projects_user
method_name: Projects_user#project_exists
file_path: app/models/projects_user.rb
file_name: app/models/projects_user.rb
line_number:
hash_key: '["app/models/projects_user.rb", "Projects_user", "Projects_user#project_exists"]'
simple_method_name: "#project_exists"
details:
saikuro: complexity is 2.0
reek: found 1 code smells
- location:
class_name: Projects_user
method_name: Projects_user#user_exists
file_path: app/models/projects_user.rb
file_name: app/models/projects_user.rb
line_number:
hash_key: '["app/models/projects_user.rb", "Projects_user", "Projects_user#user_exists"]'
simple_method_name: "#user_exists"
details:
saikuro: complexity is 2.0
reek: found 1 code smells
- location:
class_name: UsersController
method_name: UsersController#emailExist
file_path: app/controllers/users_controller.rb
file_name: app/controllers/users_controller.rb
line_number:
hash_key: '["app/controllers/users_controller.rb", "UsersController", "UsersController#emailExist"]'
simple_method_name: "#emailExist"
details:
saikuro: complexity is 2.0
reek: found 1 code smells
rcov: uncovered code is 0.0%
- location:
class_name: ProjectsController
method_name: ProjectsController#update
file_path: "./app/controllers/projects_controller.rb"
file_name: "./app/controllers/projects_controller.rb"
line_number:
hash_key: '["./app/controllers/projects_controller.rb", "ProjectsController",
"ProjectsController#update"]'
simple_method_name: "#update"
details:
saikuro: complexity is 2.0
rcov: uncovered code is 0.0%
- location:
class_name: ProjectsController
method_name: ProjectsController#create
file_path: "./app/controllers/projects_controller.rb"
file_name: "./app/controllers/projects_controller.rb"
line_number:
hash_key: '["./app/controllers/projects_controller.rb", "ProjectsController",
"ProjectsController#create"]'
simple_method_name: "#create"
details:
saikuro: complexity is 2.0
rcov: uncovered code is 0.0%
- location:
class_name: UsersController
method_name: UsersController#update
file_path: "./app/controllers/users_controller.rb"
file_name: "./app/controllers/users_controller.rb"
line_number:
hash_key: '["./app/controllers/users_controller.rb", "UsersController", "UsersController#update"]'
simple_method_name: "#update"
details:
saikuro: complexity is 2.0
rcov: uncovered code is 0.0%
- location:
class_name: UsersController
method_name: UsersController#create
file_path: "./app/controllers/users_controller.rb"
file_name: "./app/controllers/users_controller.rb"
line_number:
hash_key: '["./app/controllers/users_controller.rb", "UsersController", "UsersController#create"]'
simple_method_name: "#create"
details:
saikuro: complexity is 2.0
rcov: uncovered code is 0.0%
- location:
class_name: UsersController
method_name: UsersController#usernameExist
file_path: app/controllers/users_controller.rb
file_name: app/controllers/users_controller.rb
line_number:
hash_key: '["app/controllers/users_controller.rb", "UsersController", "UsersController#usernameExist"]'
simple_method_name: "#usernameExist"
details:
saikuro: complexity is 2.0
reek: found 1 code smells
rcov: uncovered code is 0.0%
- location:
class_name: Note
method_name: Note#note_has_atleast_one_character
file_path: "./app/models/note.rb"
file_name: "./app/models/note.rb"
line_number:
hash_key: '["./app/models/note.rb", "Note", "Note#note_has_atleast_one_character"]'
simple_method_name: "#note_has_atleast_one_character"
details:
saikuro: complexity is 2.0
rcov: uncovered code is 0.0%
- location:
class_name: Share
method_name: Share#share_has_atleast_one_character
file_path: "./app/models/share.rb"
file_name: "./app/models/share.rb"
line_number:
hash_key: '["./app/models/share.rb", "Share", "Share#share_has_atleast_one_character"]'
simple_method_name: "#share_has_atleast_one_character"
details:
saikuro: complexity is 2.0
rcov: uncovered code is 0.0%
- location:
class_name: SessionsController
method_name: SessionsController#create
file_path: "./app/controllers/sessions_controller.rb"
file_name: "./app/controllers/sessions_controller.rb"
line_number:
hash_key: '["./app/controllers/sessions_controller.rb", "SessionsController",
"SessionsController#create"]'
simple_method_name: "#create"
details:
saikuro: complexity is 2.0
rcov: uncovered code is 0.0%
- location:
class_name: ApplicationController
method_name: ApplicationController#authenticate
file_path: "./app/controllers/application_controller.rb"
file_name: "./app/controllers/application_controller.rb"
line_number:
hash_key: '["./app/controllers/application_controller.rb", "ApplicationController",
"ApplicationController#authenticate"]'
simple_method_name: "#authenticate"
details:
saikuro: complexity is 2.0
rcov: uncovered code is 0.0%
- location:
class_name: Comment
method_name: Comment#comment_has_atleast_one_character
file_path: "./app/models/comment.rb"
file_name: "./app/models/comment.rb"
line_number:
hash_key: '["./app/models/comment.rb", "Comment", "Comment#comment_has_atleast_one_character"]'
simple_method_name: "#comment_has_atleast_one_character"
details:
saikuro: complexity is 2.0
rcov: uncovered code is 0.0%
- location:
class_name: Project
method_name: Project#require_at_least_on_user
file_path: "./app/models/project.rb"
file_name: "./app/models/project.rb"
line_number:
hash_key: '["./app/models/project.rb", "Project", "Project#require_at_least_on_user"]'
simple_method_name: "#require_at_least_on_user"
details:
saikuro: complexity is 2.0
rcov: uncovered code is 0.0%
- location:
class_name: UsersController
method_name: UsersController#checkExist?
file_path: app/controllers/users_controller.rb
file_name: app/controllers/users_controller.rb
line_number:
hash_key: '["app/controllers/users_controller.rb", "UsersController", "UsersController#checkExist?"]'
simple_method_name: "#checkExist?"
details:
saikuro: complexity is 1.0
reek: found 2 code smells
rcov: uncovered code is 0.0%
- location:
class_name: ProjectsController
method_name: ProjectsController#project_params
file_path: "./app/controllers/projects_controller.rb"
file_name: "./app/controllers/projects_controller.rb"
line_number:
hash_key: '["./app/controllers/projects_controller.rb", "ProjectsController",
"ProjectsController#project_params"]'
simple_method_name: "#project_params"
details:
saikuro: complexity is 1.0
rcov: uncovered code is 0.0%
- location:
class_name: UsersController
method_name: UsersController#user_params
file_path: "./app/controllers/users_controller.rb"
file_name: "./app/controllers/users_controller.rb"
line_number:
hash_key: '["./app/controllers/users_controller.rb", "UsersController", "UsersController#user_params"]'
simple_method_name: "#user_params"
details:
saikuro: complexity is 1.0
rcov: uncovered code is 0.0%
- location:
class_name: SharesController
method_name: SharesController#share_params
file_path: "./app/controllers/shares_controller.rb"
file_name: "./app/controllers/shares_controller.rb"
line_number:
hash_key: '["./app/controllers/shares_controller.rb", "SharesController", "SharesController#share_params"]'
simple_method_name: "#share_params"
details:
saikuro: complexity is 1.0
rcov: uncovered code is 0.0%
- location:
class_name: SessionsController
method_name: SessionsController#show
file_path: "./app/controllers/sessions_controller.rb"
file_name: "./app/controllers/sessions_controller.rb"
line_number:
hash_key: '["./app/controllers/sessions_controller.rb", "SessionsController",
"SessionsController#show"]'
simple_method_name: "#show"
details:
saikuro: complexity is 1.0
rcov: uncovered code is 0.0%
- location:
class_name: SessionsController
method_name: SessionsController#destroy
file_path: "./app/controllers/sessions_controller.rb"
file_name: "./app/controllers/sessions_controller.rb"
line_number:
hash_key: '["./app/controllers/sessions_controller.rb", "SessionsController",
"SessionsController#destroy"]'
simple_method_name: "#destroy"
details:
saikuro: complexity is 1.0
rcov: uncovered code is 0.0%