pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: complexity of pspp source


From: John Darrington
Subject: Re: complexity of pspp source
Date: Sun, 31 Jan 2016 08:43:16 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Jan 30, 2016 at 02:56:27PM -0800, Ben Pfaff wrote:
     On Sun, Jan 24, 2016 at 09:24:58AM +0100, John Darrington wrote:
     > I thought it instructive to run the attached syntax to find out where
     > potential problems might lie in our source code.  (Must be run from
     > ./src )
     
     What did you learn from the results?

Nothing that was particularly suprising:  The ten "least maintainable" 
functions are:

61      64      220     3558    433     ./ui/gui/pspp-sheet-view.c 
pspp_sheet_view_draw_bin
65      65      181     191     275     ./language/stats/descriptives.c 
cmd_descriptives
65      65      210     751     377     ./language/stats/logistic.c cmd_logistic
66      66      124     4293    237     ./ui/gui/pspp-sheet-view.c 
pspp_sheet_view_key_press
66      66      227     143     356     ./language/data-io/combine-files.c 
combine_files
76      76      224     1893    425     ./language/stats/examine.c cmd_examine
57      88      185     154     359     ./language/stats/npar.c parse_npar_tests
89      89      226     3057    471     ./ui/gui/pspp-sheet-view-column.c 
pspp_sheet_view_column_cell_process_action
90      90      204     1006    408     ./language/stats/factor.c cmd_factor
115     115     344     578     665     ./language/stats/frequencies.c 
cmd_frequencies

Three of these are related to pspp-sheet.  
The remaining seven are all related to syntax_parsing, and four of them (at 
least from my memory) have a
heritage from the very early days of pspp.

Those syntax related ones all seem to contain a lot of repetitive code of the 
form:


              ...
              else if (lex_match_id (lexer, "ITERATE"))
                {
                  if ( lex_force_match (lexer, T_LPAREN)
                       && lex_force_int (lexer))
                    {
                      n_iterations = lex_integer (lexer);
                      lex_get (lexer);
                      lex_force_match (lexer, T_RPAREN);
                    }
                }
              else if .....

and we did have a bug report recently which turned out to be related to an error
in such a section.  Perhaps we could have a function to deal with those.


J'


-- 
Avoid eavesdropping.  Send strong encryted email.
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]