Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6069827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:51:53+00:00 2026-05-23T09:51:53+00:00

Before my rake stats modification +———————-+——-+——-+———+———+—–+——-+ | Name | Lines | LOC | Classes

  • 0

Before my rake stats modification

+----------------------+-------+-------+---------+---------+-----+-------+
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers          |  5037 |  3936 |      31 |     292 |   9 |    11 |
| Helpers              |   150 |   128 |       0 |      17 |   0 |     5 |
| Models               |  1523 |  1166 |      42 |     123 |   2 |     7 |
| Libraries            |   633 |   415 |       4 |      65 |  16 |     4 |
| Functional tests     |   289 |   228 |      13 |       0 |   0 |     0 |
| Unit tests           |   560 |   389 |      30 |       0 |   0 |     0 |
| Model specs          |  1085 |   904 |       0 |       3 |   0 |   299 |
| View specs           |    88 |    75 |       0 |       0 |   0 |     0 |
| Controller specs     |   468 |   388 |       0 |       2 |   0 |   192 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total                |  9833 |  7629 |     120 |     502 |   4 |    13 |
+----------------------+-------+-------+---------+---------+-----+-------+
  Code LOC: 5645     Test LOC: 1984     Code to Test Ratio: 1:0.4

now, when I add:

#Factories
::STATS_DIRECTORIES << %w(Factories\ specs test/factories) if File.exist?('test/factories')
::CodeStatistics::TEST_TYPES << "Factory specs" if File.exist?('test/factories')

around line 120, it should increase test LOC, right?

+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers          |  5037 |  3936 |      31 |     292 |   9 |    11 |
| Helpers              |   150 |   128 |       0 |      17 |   0 |     5 |
| Models               |  1523 |  1166 |      42 |     123 |   2 |     7 |
| Libraries            |   633 |   415 |       4 |      65 |  16 |     4 |
| Functional tests     |   289 |   228 |      13 |       0 |   0 |     0 |
| Unit tests           |   560 |   389 |      30 |       0 |   0 |     0 |
| Model specs          |  1085 |   904 |       0 |       3 |   0 |   299 |
| View specs           |    88 |    75 |       0 |       0 |   0 |     0 |
| Controller specs     |   468 |   388 |       0 |       2 |   0 |   192 |
| Factories specs      |   144 |   119 |       0 |       0 |   0 |     0 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total                |  9977 |  7748 |     120 |     502 |   4 |    13 |
+----------------------+-------+-------+---------+---------+-----+-------+
  Code LOC: 5764     Test LOC: 1984     Code to Test Ratio: 1:0.3

Instead of adding tho 144 lines from factories to test LOC, it adds them to code LOC =\
How do I get the line count to be in Test LOC?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:51:54+00:00Added an answer on May 23, 2026 at 9:51 am

    You’re adding something called “Factories specs” (plural) to the STATS_DIRECTORIES array, but you call it “Factory specs” (singular) when you add it to TEST_TYPES array — so when rake:stat hits your test/factories folder, it looks for “Factories specs” in TEST_TYPES, doesn’t find it, and assumes it’s code, not tests. You need to call it the same thing in both places:

    ::STATS_DIRECTORIES << %w(Factory\ specs test/factories) if File.exist?('test/factories')
    ::CodeStatistics::TEST_TYPES << "Factory specs" if File.exist?('test/factories')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Before you answer this I have never developed anything popular enough to attain high
Before I start, I know there is this post and it doesn't answer my
Before I do this I figured I would ask if it was the best
Before I jump headlong into C#... I've always felt that C, or maybe C++,
Before, I have found the Cost in the execution plan to be a good
Before moving on to use SVN, I used to manage my project by simply
Before anyone suggests scrapping the table tags altogether, I'm just modifying this part of
Before I upgraded to Firefox 3 I used to constantly use the View Source
Before you start firing at me, I'm NOT looking to do this, but someone
Before you answer, this question is complicated: We are developing in asp.net / asp.net

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.