Commit Graph

13 Commits

Author SHA1 Message Date
Michael Hohn
cf8096446b sarif-to-dot: cleanup for and preparation for sarif table extraction 2022-02-01 22:42:25 -08:00
Michael Hohn
80b22001ce sarif-to-dot: make signature names order-independent
To create entire subtrees conforming to a signature, first make the
signature names order-independent.  Use hashes to name the signatures.
2022-01-27 17:53:14 -08:00
Michael Hohn
153eba8346 sarif-to-dot: to reduce graph clutter, add option --no-edges-to-scalars 2022-01-26 00:41:31 -08:00
Michael Hohn
b816705574 sarif-to-dot: add --fill-structure option and initial library support
This collapses the rightmost column of the signature output from

    ../../bin/sarif-to-dot -u -t -d -f results.sarif | dot -Tpdf

which has multiple distinct entries

 ('Struct030', ('struct', ('endColumn', 'Int'), ('startLine', 'Int'))),
 ( 'Struct016',
    ( 'struct',
      ('endColumn', 'Int'),
      ('startColumn', 'Int'),
      ('startLine', 'Int'))),
 ( 'Struct025',
    ( 'struct',
      ('endColumn', 'Int'),
      ('endLine', 'Int'),
      ('startColumn', 'Int'),
      ('startLine', 'Int'))),
 ('Struct030', ('struct', ('endColumn', 'Int'), ('startLine', 'Int'))),

to a single entry,

  ( 'Struct005',
    ( 'struct',
      ('endColumn', 'Int'),
      ('endLine', 'Int'),
      ('startColumn', 'Int'),
      ('startLine', 'Int'))),

when using

    ../../bin/sarif-to-dot results.sarif -u -t -f
2022-01-25 23:18:20 -08:00
Michael Hohn
edfe1f3363 sarif-to-dot: move signature functions into their own module 2022-01-25 17:57:44 -08:00
Michael Hohn
0444a87076 sarif-to-dot: remove module-variable references 2022-01-25 17:49:07 -08:00
Michael Hohn
86caa3f56f sarif-to-dot: small renaming 2022-01-24 17:24:30 -08:00
Michael Hohn
939ba9bd8a sarif-to-dot: output array signatures as nodes, not edges; fix raise statements 2022-01-20 18:09:45 -08:00
Michael Hohn
cef9b47b58 sarif-to-dot: produce dot output using -d option
The command
   ../../bin/sarif-to-dot results.sarif -u -t -d | dot -Tpdf > raw-nested-types.pdf
produces a good illustration of the problems arising when optional values are absent.
To clean this up, structures missing fields have to be supplemented with those fields,
from right to left in the graph.
This is basically what sarif-results-summary does on the fly, it just has to be applied
to the input tree before collecting the signatures and producing this graph.
Once that is done, the types collected here can be used in SQL table export.
2022-01-16 14:21:23 -08:00
Michael Hohn
d64b100101 sarif-to-dot: move processing code to the end 2022-01-16 01:39:24 -08:00
Michael Hohn
b94be6a21e sarif-to-dot: map values to their typedf 2022-01-16 01:26:24 -08:00
Michael Hohn
afca6b341a sarif-to-dot: improved output, add three options
-   Full view with some clean-up:
    45608 lines

        cd ~/local/sarif-cli/data/treeio
        ../../bin/sarif-to-dot results.sarif | tr -d "',[]"  |less

-   Only show unique array entry signatures
    1573 lines

        cd ~/local/sarif-cli/data/treeio
        ../../bin/sarif-to-dot results.sarif -u | tr -d "',[]"  |less

-   Only show unique array entry signatures, typedef object signatures
    338 lines

        cd ~/local/sarif-cli/data/treeio
        ../../bin/sarif-to-dot results.sarif -u -t | tr -d "',[]"  |less
2022-01-16 01:07:24 -08:00
Michael Hohn
706e4cdd54 sarif-to-dot: Print the type signature of a sarif file, at various levels of verbosity. 2022-01-15 23:05:06 -08:00