Next Program Repair Shop 8

Counting Lines of Code: Rules

        unless ($page->param('round')) {        # 1
           $round = 0;                          # 2
        }else {
           $round = $page->param('round');      # 3
        }
        unless ($page->param('round')) { $round = 0 }   # 1-2
        else { $round = $page->param('round') }         # 3
  1. Basic principle: Items with new semantic content count; others do not

  2. White space does not count

  3. Each simple statement counts for 1

  4. Control clauses such as while, if, etc. count for 1

  5. do and else don't count

  6. Don't worry too much about details



Next Copyright © 2002 M. J. Dominus