adlint 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/AUTHORS +27 -0
- data/COPYING +674 -0
- data/ChangeLog +820 -0
- data/INSTALL +78 -0
- data/MANIFEST +464 -0
- data/NEWS +38 -0
- data/README +74 -0
- data/Rakefile +167 -0
- data/TODO +29 -0
- data/bin/adlint +141 -0
- data/bin/adlint_chk +129 -0
- data/bin/adlint_cma +122 -0
- data/bin/adlint_sma +129 -0
- data/bin/adlintize +286 -0
- data/etc/conf.d/fallback/cinit.erb +11 -0
- data/etc/conf.d/fallback/traits.erb +216 -0
- data/etc/conf.d/i686-cygwin/cinit-gcc_4.3.4.erb +149 -0
- data/etc/conf.d/i686-cygwin/traits-gcc_4.3.4.erb +227 -0
- data/etc/conf.d/i686-devkit/cinit-gcc_4.5.2.erb +224 -0
- data/etc/conf.d/i686-devkit/traits-gcc_4.5.2.erb +226 -0
- data/etc/conf.d/i686-linux/cinit-gcc_4.5.1.erb +219 -0
- data/etc/conf.d/i686-linux/traits-gcc_4.5.1.erb +224 -0
- data/etc/conf.d/i686-mingw/cinit-gcc_4.6.1.erb +234 -0
- data/etc/conf.d/i686-mingw/traits-gcc_4.6.1.erb +226 -0
- data/etc/conf.d/noarch/GNUmakefile.erb +119 -0
- data/etc/conf.d/noarch/adlint_all_bat.erb +9 -0
- data/etc/conf.d/noarch/adlint_all_sh.erb +10 -0
- data/etc/conf.d/noarch/pinit.erb +11 -0
- data/etc/mesg.d/en_US/messages.yml +784 -0
- data/etc/mesg.d/ja_JP/messages.yml +784 -0
- data/lib/adlint/analyzer.rb +294 -0
- data/lib/adlint/c/branch.rb +251 -0
- data/lib/adlint/c/builtin.rb +92 -0
- data/lib/adlint/c/code.rb +490 -0
- data/lib/adlint/c/const.rb +465 -0
- data/lib/adlint/c/conv.rb +212 -0
- data/lib/adlint/c/ctrlexpr.rb +949 -0
- data/lib/adlint/c/domain.rb +7499 -0
- data/lib/adlint/c/environ.rb +133 -0
- data/lib/adlint/c/expr.rb +1725 -0
- data/lib/adlint/c/format.rb +3209 -0
- data/lib/adlint/c/interp.rb +1740 -0
- data/lib/adlint/c/lexer.rb +241 -0
- data/lib/adlint/c/mediator.rb +313 -0
- data/lib/adlint/c/message.rb +13597 -0
- data/lib/adlint/c/metric.rb +765 -0
- data/lib/adlint/c/object.rb +1018 -0
- data/lib/adlint/c/parser.rb +3800 -0
- data/lib/adlint/c/parser.y +2054 -0
- data/lib/adlint/c/phase.rb +712 -0
- data/lib/adlint/c/resolver.rb +270 -0
- data/lib/adlint/c/scanner.rb +248 -0
- data/lib/adlint/c/scope.rb +74 -0
- data/lib/adlint/c/syntax.rb +4279 -0
- data/lib/adlint/c/type.rb +7506 -0
- data/lib/adlint/c/util.rb +91 -0
- data/lib/adlint/c/value.rb +2310 -0
- data/lib/adlint/c.rb +56 -0
- data/lib/adlint/code.rb +500 -0
- data/lib/adlint/cpp/code.rb +189 -0
- data/lib/adlint/cpp/constexpr.rb +721 -0
- data/lib/adlint/cpp/constexpr.y +389 -0
- data/lib/adlint/cpp/eval.rb +1012 -0
- data/lib/adlint/cpp/lexer.rb +860 -0
- data/lib/adlint/cpp/macro.rb +637 -0
- data/lib/adlint/cpp/message.rb +992 -0
- data/lib/adlint/cpp/phase.rb +176 -0
- data/lib/adlint/cpp/scanner.rb +93 -0
- data/lib/adlint/cpp/source.rb +169 -0
- data/lib/adlint/cpp/subst.rb +300 -0
- data/lib/adlint/cpp/syntax.rb +1412 -0
- data/lib/adlint/cpp/util.rb +97 -0
- data/lib/adlint/cpp.rb +43 -0
- data/lib/adlint/driver.rb +147 -0
- data/lib/adlint/error.rb +179 -0
- data/lib/adlint/lang.rb +97 -0
- data/lib/adlint/ld/message.rb +259 -0
- data/lib/adlint/ld/metric.rb +57 -0
- data/lib/adlint/ld/object.rb +542 -0
- data/lib/adlint/ld/phase.rb +193 -0
- data/lib/adlint/ld/typedef.rb +109 -0
- data/lib/adlint/ld/util.rb +88 -0
- data/lib/adlint/ld.rb +37 -0
- data/lib/adlint/lexer.rb +293 -0
- data/lib/adlint/message.rb +368 -0
- data/lib/adlint/metric.rb +805 -0
- data/lib/adlint/monitor.rb +144 -0
- data/lib/adlint/phase.rb +90 -0
- data/lib/adlint/prelude.rb +314 -0
- data/lib/adlint/report.rb +617 -0
- data/lib/adlint/source.rb +155 -0
- data/lib/adlint/symbol.rb +127 -0
- data/lib/adlint/token.rb +215 -0
- data/lib/adlint/traits.rb +643 -0
- data/lib/adlint/util.rb +524 -0
- data/lib/adlint/version.rb +71 -0
- data/lib/adlint.rb +66 -0
- data/share/HEADER +45 -0
- data/share/demo/Makefile +110 -0
- data/share/demo/ambig_operator/ambig_operator.c +289 -0
- data/share/demo/arg_points_unset/arg_points_unset.c +37 -0
- data/share/demo/array_range/array_range.c +62 -0
- data/share/demo/bad_bitfields/bad_bitfields.c +74 -0
- data/share/demo/bad_brace/bad_brace.c +19 -0
- data/share/demo/bad_charset/abcde$.h +0 -0
- data/share/demo/bad_charset/bad_charset.c +22 -0
- data/share/demo/bad_comment/bad_comment.c +3 -0
- data/share/demo/bad_const/bad_const.c +19 -0
- data/share/demo/bad_conv/bad_conv.c +48 -0
- data/share/demo/bad_indent/bad_indent.c +50 -0
- data/share/demo/bad_init/bad_init.c +49 -0
- data/share/demo/bad_macro/bad_macro.c +97 -0
- data/share/demo/bitwise_expr/bitwise_expr.c +19 -0
- data/share/demo/call_by_value/call_by_value.c +26 -0
- data/share/demo/cross_ref/cross_ref.c +21 -0
- data/share/demo/dangling_else/dangling_else.c +20 -0
- data/share/demo/dead_code/dead_code.c +237 -0
- data/share/demo/deep_nest/deep_nest.c +57 -0
- data/share/demo/dense_switch/dense_switch.c +62 -0
- data/share/demo/direct_recur/direct_recur.c +15 -0
- data/share/demo/div_by_zero/div_by_zero.c +35 -0
- data/share/demo/dos_source/dos_source.c +7 -0
- data/share/demo/funptr_cast/funptr_cast.c +26 -0
- data/share/demo/goto_stmt/goto_stmt.c +19 -0
- data/share/demo/id_hiding/id_hiding.c +19 -0
- data/share/demo/ill_defined/ill_defined.c +13 -0
- data/share/demo/implicit_conv/implicit_conv.c +60 -0
- data/share/demo/implicit_int/implicit_int.c +14 -0
- data/share/demo/incomplete_type/incomplete_type.c +49 -0
- data/share/demo/indirect_recur/indirect_recur_1.c +14 -0
- data/share/demo/indirect_recur/indirect_recur_1.h +7 -0
- data/share/demo/indirect_recur/indirect_recur_2.c +12 -0
- data/share/demo/indirect_recur/indirect_recur_2.h +6 -0
- data/share/demo/indirect_recur/indirect_recur_3.c +6 -0
- data/share/demo/indirect_recur/indirect_recur_3.h +6 -0
- data/share/demo/indirect_recur/indirect_recur_4.c +25 -0
- data/share/demo/intro_demo/intro_demo.c +76 -0
- data/share/demo/intro_demo/intro_demo.h +12 -0
- data/share/demo/intro_demo/useless_header.h +5 -0
- data/share/demo/invalid_call/invalid_call.c +32 -0
- data/share/demo/kandr_fundef/kandr_fundef.c +10 -0
- data/share/demo/line_comment/line_comment.c +12 -0
- data/share/demo/local_decl/local_decl.c +9 -0
- data/share/demo/logical_trick/logical_trick.c +36 -0
- data/share/demo/long_sym/long_sym.c +5 -0
- data/share/demo/loop_var/loop_var.c +92 -0
- data/share/demo/malloc_or_die/malloc_or_die.c +43 -0
- data/share/demo/may_be_null/may_be_null.c +52 -0
- data/share/demo/may_be_null_arith/may_be_null_arith.c +15 -0
- data/share/demo/may_be_unset/may_be_unset.c +34 -0
- data/share/demo/mmapped_io/mmapped_io.c +23 -0
- data/share/demo/multi_break/multi_break.c +33 -0
- data/share/demo/multi_decl/multi_decl_1.c +17 -0
- data/share/demo/multi_decl/multi_decl_1.h +6 -0
- data/share/demo/multi_decl/multi_decl_2.c +13 -0
- data/share/demo/multi_decl/multi_decl_2.h +6 -0
- data/share/demo/multi_decl/multi_decl_3.c +22 -0
- data/share/demo/multi_def/multi_def_1.c +36 -0
- data/share/demo/multi_def/multi_def_1.h +6 -0
- data/share/demo/multi_def/multi_def_2.c +22 -0
- data/share/demo/multi_def/multi_def_2.h +6 -0
- data/share/demo/multi_def/multi_def_3.c +6 -0
- data/share/demo/multi_typedef/multi_typedef.c +11 -0
- data/share/demo/multi_typedef/multi_typedef_1.h +1 -0
- data/share/demo/multi_typedef/multi_typedef_2.h +1 -0
- data/share/demo/must_be_false/must_be_false.c +53 -0
- data/share/demo/must_be_null/must_be_null.c +13 -0
- data/share/demo/must_be_null_arith/must_be_null_arith.c +14 -0
- data/share/demo/must_be_true/must_be_true.c +21 -0
- data/share/demo/no_eof_nl/no_eof_nl.c +4 -0
- data/share/demo/no_void_arg/no_void_arg.c +14 -0
- data/share/demo/null_stmt/null_stmt.c +19 -0
- data/share/demo/octal_const/octal_const.c +20 -0
- data/share/demo/output_by_param/output_by_param.c +17 -0
- data/share/demo/overflow/overflow.c +74 -0
- data/share/demo/press_release/press_release.c +40 -0
- data/share/demo/retn_lvar_addr/retn_lvar_addr.c +47 -0
- data/share/demo/shift_expr/shift_expr.c +14 -0
- data/share/demo/should_be_typedef/should_be_typedef.c +51 -0
- data/share/demo/static_paths/static_paths.c +153 -0
- data/share/demo/static_vars/static_vars.c +39 -0
- data/share/demo/tag_hiding/tag_hiding.c +18 -0
- data/share/demo/tricky_incdec/tricky_incdec.c +12 -0
- data/share/demo/undefined_macro/undefined_macro.c +17 -0
- data/share/demo/uninit_vars/uninit_vars.c +28 -0
- data/share/demo/union_type/union_type.c +23 -0
- data/share/demo/unmatch_decl/unmatch_decl_1.c +12 -0
- data/share/demo/unmatch_decl/unmatch_decl_1.h +8 -0
- data/share/demo/unmatch_decl/unmatch_decl_2.c +10 -0
- data/share/demo/unmatch_decl/unmatch_decl_2.h +8 -0
- data/share/demo/unmatch_decl/unmatch_decl_3.c +7 -0
- data/share/demo/unmatch_paren_macro/unmatch_paren_macro.c +15 -0
- data/share/demo/unreachable/unreachable.c +34 -0
- data/share/demo/useless_exp_funs/useless_exp_funs_1.c +14 -0
- data/share/demo/useless_exp_funs/useless_exp_funs_1.h +1 -0
- data/share/demo/useless_exp_funs/useless_exp_funs_2.c +6 -0
- data/share/demo/useless_exp_vars/useless_export_1.c +8 -0
- data/share/demo/useless_exp_vars/useless_export_1.h +1 -0
- data/share/demo/useless_exp_vars/useless_export_2.c +7 -0
- data/share/demo/useless_expr/useless_expr.c +17 -0
- data/share/demo/useless_funs/useless_funs_1.c +21 -0
- data/share/demo/useless_funs/useless_funs_1.h +8 -0
- data/share/demo/useless_funs/useless_funs_2.c +6 -0
- data/share/demo/useless_header/useless_header.c +9 -0
- data/share/demo/useless_header/useless_header_1.h +12 -0
- data/share/demo/useless_header/useless_header_2.h +6 -0
- data/share/demo/useless_header/useless_header_3.h +9 -0
- data/share/demo/useless_header/useless_header_4.h +3 -0
- data/share/demo/useless_vars/useless_vars.c +17 -0
- data/share/demo/va_funcall/va_funcall.c +25 -0
- data/share/demo/various_fundef/various_fundef.c +36 -0
- data/share/demo/wchar_wstring/wchar_wstring.c +7 -0
- data/share/demo/wrap_around/wrap_around.c +38 -0
- data/share/doc/Makefile +16 -0
- data/share/doc/adlint_on_adqua.png +0 -0
- data/share/doc/adlint_on_eclipse_en.png +0 -0
- data/share/doc/adlint_on_eclipse_ja.png +0 -0
- data/share/doc/adlint_on_vim_en.png +0 -0
- data/share/doc/adlint_on_vim_ja.png +0 -0
- data/share/doc/developers_guide_ja.html +171 -0
- data/share/doc/developers_guide_ja.texi +87 -0
- data/share/doc/gen_mesg_sections.rb +39 -0
- data/share/doc/samples/GNUmakefile +162 -0
- data/share/doc/samples/adlint_traits.yml +238 -0
- data/share/doc/texinfo.css +22 -0
- data/share/doc/users_guide_en.html +39975 -0
- data/share/doc/users_guide_en.texi +32640 -0
- data/share/doc/users_guide_ja.html +40505 -0
- data/share/doc/users_guide_ja.texi +33189 -0
- data/share/logo/adlint-110.png +0 -0
- data/share/logo/adlint-524.png +0 -0
- data/share/logo/adlint.svg +4637 -0
- data/share/sample/README +6 -0
- data/share/sample/bison-2.5/adlint/GNUmakefile +170 -0
- data/share/sample/bison-2.5/adlint/adlint_traits.yml +225 -0
- data/share/sample/bison-2.5/adlint/lib/GNUmakefile +198 -0
- data/share/sample/bison-2.5/adlint/lib/adlint_cinit.h +228 -0
- data/share/sample/bison-2.5/adlint/lib/adlint_pinit.h +21 -0
- data/share/sample/bison-2.5/adlint/lib/adlint_traits.yml +238 -0
- data/share/sample/bison-2.5/adlint/src/GNUmakefile +166 -0
- data/share/sample/bison-2.5/adlint/src/adlint_cinit.h +228 -0
- data/share/sample/bison-2.5/adlint/src/adlint_pinit.h +21 -0
- data/share/sample/bison-2.5/adlint/src/adlint_traits.yml +239 -0
- data/share/sample/ctags-5.8/adlint/GNUmakefile +169 -0
- data/share/sample/ctags-5.8/adlint/adlint_cinit.h +219 -0
- data/share/sample/ctags-5.8/adlint/adlint_pinit.h +13 -0
- data/share/sample/ctags-5.8/adlint/adlint_traits.yml +225 -0
- data/share/sample/flex-2.5.35/adlint/GNUmakefile +140 -0
- data/share/sample/flex-2.5.35/adlint/adlint_cinit.h +219 -0
- data/share/sample/flex-2.5.35/adlint/adlint_pinit.h +14 -0
- data/share/sample/flex-2.5.35/adlint/adlint_traits.yml +225 -0
- data/share/sample/ruby-1.9.3-p0/adlint/GNUmakefile +314 -0
- data/share/sample/ruby-1.9.3-p0/adlint/adlint_traits.yml +225 -0
- data/share/sample/ruby-1.9.3-p0/adlint/core/GNUmakefile +204 -0
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_pinit.h +28 -0
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_traits.yml +240 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc/GNUmakefile +163 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_traits.yml +240 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/GNUmakefile +149 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_traits.yml +240 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/GNUmakefile +134 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/GNUmakefile +134 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/GNUmakefile +140 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/GNUmakefile +134 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/GNUmakefile +162 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/GNUmakefile +135 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/GNUmakefile +144 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/GNUmakefile +140 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_traits.yml +241 -0
- data/share/sample/screen-4.0.3/adlint/GNUmakefile +162 -0
- data/share/sample/screen-4.0.3/adlint/adlint_cinit.h +228 -0
- data/share/sample/screen-4.0.3/adlint/adlint_pinit.h +21 -0
- data/share/sample/screen-4.0.3/adlint/adlint_traits.yml +238 -0
- data/share/sample/vim-7.3/adlint/vim/GNUmakefile +185 -0
- data/share/sample/vim-7.3/adlint/vim/adlint_cinit.h +228 -0
- data/share/sample/vim-7.3/adlint/vim/adlint_pinit.h +25 -0
- data/share/sample/vim-7.3/adlint/vim/adlint_traits.yml +250 -0
- data/share/sample/vim-7.3/adlint/xxd/GNUmakefile +131 -0
- data/share/sample/vim-7.3/adlint/xxd/adlint_cinit.h +228 -0
- data/share/sample/vim-7.3/adlint/xxd/adlint_pinit.h +24 -0
- data/share/sample/vim-7.3/adlint/xxd/adlint_traits.yml +237 -0
- data/share/sample/zsh-4.3.15/adlint/GNUmakefile +146 -0
- data/share/sample/zsh-4.3.15/adlint/adlint_traits.yml +225 -0
- data/share/sample/zsh-4.3.15/adlint/builtins/GNUmakefile +132 -0
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_cinit.h +228 -0
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_pinit.h +24 -0
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_traits.yml +240 -0
- data/share/sample/zsh-4.3.15/adlint/core/GNUmakefile +153 -0
- data/share/sample/zsh-4.3.15/adlint/core/adlint_cinit.h +228 -0
- data/share/sample/zsh-4.3.15/adlint/core/adlint_pinit.h +23 -0
- data/share/sample/zsh-4.3.15/adlint/core/adlint_traits.yml +239 -0
- data/share/sample/zsh-4.3.15/adlint/modules/GNUmakefile +147 -0
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_cinit.h +228 -0
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_pinit.h +24 -0
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_traits.yml +240 -0
- data/share/sample/zsh-4.3.15/adlint/zle/GNUmakefile +144 -0
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_cinit.h +228 -0
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_pinit.h +24 -0
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_traits.yml +239 -0
- data/spec/MUST_WRITE_SPECS_WITH_RSPEC +0 -0
- metadata +532 -0
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
# Analysis report and its manipulation utility.
|
|
2
|
+
#
|
|
3
|
+
# Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
|
4
|
+
# Copyright:: Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
|
|
5
|
+
# License:: GPLv3+: GNU General Public License version 3 or later
|
|
6
|
+
#
|
|
7
|
+
# Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
|
8
|
+
|
|
9
|
+
#--
|
|
10
|
+
# ___ ____ __ ___ _________
|
|
11
|
+
# / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
|
|
12
|
+
# / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
|
|
13
|
+
# / __ |/ /_/ / /___/ / /| / / /
|
|
14
|
+
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
|
|
15
|
+
#
|
|
16
|
+
# This file is part of AdLint.
|
|
17
|
+
#
|
|
18
|
+
# AdLint is free software: you can redistribute it and/or modify it under the
|
|
19
|
+
# terms of the GNU General Public License as published by the Free Software
|
|
20
|
+
# Foundation, either version 3 of the License, or (at your option) any later
|
|
21
|
+
# version.
|
|
22
|
+
#
|
|
23
|
+
# AdLint is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
24
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
25
|
+
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
26
|
+
#
|
|
27
|
+
# You should have received a copy of the GNU General Public License along with
|
|
28
|
+
# AdLint. If not, see <http://www.gnu.org/licenses/>.
|
|
29
|
+
#
|
|
30
|
+
#++
|
|
31
|
+
|
|
32
|
+
require "adlint/token"
|
|
33
|
+
require "adlint/message"
|
|
34
|
+
require "adlint/code"
|
|
35
|
+
require "adlint/metric"
|
|
36
|
+
|
|
37
|
+
module AdLint #:nodoc:
|
|
38
|
+
|
|
39
|
+
# == DESCRIPTION
|
|
40
|
+
# Report information collector.
|
|
41
|
+
class Report
|
|
42
|
+
# === DESCRIPTION
|
|
43
|
+
# Constructs an empty report.
|
|
44
|
+
def initialize(msg_fpath, met_fpath, &block)
|
|
45
|
+
@msg_fpath = msg_fpath
|
|
46
|
+
@msg_file = open_message_file(msg_fpath)
|
|
47
|
+
|
|
48
|
+
@met_fpath = met_fpath
|
|
49
|
+
@met_file = open_metric_file(met_fpath)
|
|
50
|
+
|
|
51
|
+
@unique_messages = Set.new
|
|
52
|
+
|
|
53
|
+
yield(self)
|
|
54
|
+
ensure
|
|
55
|
+
@msg_file.close if @msg_file
|
|
56
|
+
@met_file.close if @met_file
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
attr_reader :msg_fpath
|
|
60
|
+
attr_reader :met_fpath
|
|
61
|
+
|
|
62
|
+
# === DESCRIPTION
|
|
63
|
+
# Adds a message to this report.
|
|
64
|
+
#
|
|
65
|
+
# === PARAMETER
|
|
66
|
+
# _message_:: Message -- Message to be added.
|
|
67
|
+
#
|
|
68
|
+
# === RETURN VALUE
|
|
69
|
+
# Report -- Self.
|
|
70
|
+
def add_message(message)
|
|
71
|
+
@msg_file.puts(message.to_csv)
|
|
72
|
+
$stderr.puts(message.to_s) unless verbose?
|
|
73
|
+
self
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def add_unique_message(message)
|
|
77
|
+
if @unique_messages.add?(message)
|
|
78
|
+
add_message(message)
|
|
79
|
+
end
|
|
80
|
+
self
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# === DESCRIPTION
|
|
84
|
+
# Adds code structure information to this report.
|
|
85
|
+
#
|
|
86
|
+
# === PARAMETER
|
|
87
|
+
# _code_struct_:: CodeStructure -- Code structure information to be added.
|
|
88
|
+
#
|
|
89
|
+
# === RETURN VALUE
|
|
90
|
+
# Report -- Self.
|
|
91
|
+
def add_code_struct(code_struct)
|
|
92
|
+
@met_file.puts(code_struct.to_csv)
|
|
93
|
+
self
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def add_code_metric(code_metric)
|
|
97
|
+
@met_file.puts(code_metric.to_csv)
|
|
98
|
+
self
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
private
|
|
102
|
+
def open_message_file(fpath)
|
|
103
|
+
File.open(fpath, "w").tap do |io|
|
|
104
|
+
io.set_encoding(Encoding.default_external)
|
|
105
|
+
io.puts(["V", SHORT_VERSION, Time.now.to_s, Dir.getwd].to_csv)
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def open_metric_file(fpath)
|
|
110
|
+
File.open(fpath, "w").tap do |io|
|
|
111
|
+
io.set_encoding(Encoding.default_external)
|
|
112
|
+
io.puts(["VER", SHORT_VERSION, Time.now.to_s, Dir.getwd].to_csv)
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
module MessageUniqueness
|
|
118
|
+
@@messages_to_be_unique = Set.new
|
|
119
|
+
|
|
120
|
+
def ensure_uniqueness_of(message_id)
|
|
121
|
+
@@messages_to_be_unique.add(message_id)
|
|
122
|
+
nil
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def must_be_unique?(message_id)
|
|
126
|
+
@@messages_to_be_unique.include?(message_id)
|
|
127
|
+
end
|
|
128
|
+
module_function :must_be_unique?
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# == DESCRIPTION
|
|
132
|
+
# Report manipulation utility.
|
|
133
|
+
module ReportUtil
|
|
134
|
+
# === DESCRIPTION
|
|
135
|
+
# Adds an error message to the report.
|
|
136
|
+
#
|
|
137
|
+
# Abbreviation below is available.
|
|
138
|
+
# add_error_message(id, location, ...) => E(id, location, ...)
|
|
139
|
+
#
|
|
140
|
+
# === PARAMETER
|
|
141
|
+
# _id_:: String -- Message id string.
|
|
142
|
+
# _location_:: Location -- Location where the message detected.
|
|
143
|
+
# _parts_:: Array< Object > -- Message formatting parts.
|
|
144
|
+
#
|
|
145
|
+
# === RETURN VALUE
|
|
146
|
+
# None.
|
|
147
|
+
def add_error_message(id, location, *parts)
|
|
148
|
+
add_message(ErrorMessage.new(id, location, *parts))
|
|
149
|
+
end
|
|
150
|
+
alias :E :add_error_message
|
|
151
|
+
module_function :add_error_message, :E
|
|
152
|
+
|
|
153
|
+
# === DESCRIPTION
|
|
154
|
+
# Adds a warning message to the report.
|
|
155
|
+
#
|
|
156
|
+
# Abbreviation below is available.
|
|
157
|
+
# add_warning_message(id, location, ...) => W(id, location, ...)
|
|
158
|
+
#
|
|
159
|
+
# === PARAMETER
|
|
160
|
+
# _id_:: String -- Message id string.
|
|
161
|
+
# _location_:: Location -- Location where the message detected.
|
|
162
|
+
# _parts_:: Array< Object > -- Message formatting parts.
|
|
163
|
+
#
|
|
164
|
+
# === RETURN VALUE
|
|
165
|
+
# None.
|
|
166
|
+
def add_warning_message(id, location, *parts)
|
|
167
|
+
add_message(WarningMessage.new(id, location, *parts))
|
|
168
|
+
end
|
|
169
|
+
alias :W :add_warning_message
|
|
170
|
+
module_function :add_warning_message, :W
|
|
171
|
+
|
|
172
|
+
# === DESCRIPTION
|
|
173
|
+
# Adds a context message to the report.
|
|
174
|
+
#
|
|
175
|
+
# Abbreviation below is available.
|
|
176
|
+
# add_context_message(id, location, ...) => C(id, location, ...)
|
|
177
|
+
#
|
|
178
|
+
# === PARAMETER
|
|
179
|
+
# _id_:: String -- Message id string.
|
|
180
|
+
# _location_:: Location -- Location where the message detected.
|
|
181
|
+
# _parts_:: Array< Object > -- Message formatting parts.
|
|
182
|
+
#
|
|
183
|
+
# === RETURN VALUE
|
|
184
|
+
# None.
|
|
185
|
+
def add_context_message(id, location, *parts)
|
|
186
|
+
add_message(ContextMessage.new(id, location, *parts))
|
|
187
|
+
end
|
|
188
|
+
alias :C :add_context_message
|
|
189
|
+
module_function :add_context_message, :C
|
|
190
|
+
|
|
191
|
+
# === DESCRIPTION
|
|
192
|
+
# Adds a message to the report.
|
|
193
|
+
#
|
|
194
|
+
# === PARAMETER
|
|
195
|
+
# _message_:: Message -- Message to be added.
|
|
196
|
+
#
|
|
197
|
+
# === RETURN VALUE
|
|
198
|
+
# None.
|
|
199
|
+
def add_message(message)
|
|
200
|
+
if MessageUniqueness.must_be_unique?(message.id)
|
|
201
|
+
report.add_unique_message(message)
|
|
202
|
+
else
|
|
203
|
+
report.add_message(message)
|
|
204
|
+
end
|
|
205
|
+
nil
|
|
206
|
+
end
|
|
207
|
+
module_function :add_message
|
|
208
|
+
|
|
209
|
+
# === DESCRIPTION
|
|
210
|
+
# Adds type declaration information to the report.
|
|
211
|
+
#
|
|
212
|
+
# Abbreviation below is available.
|
|
213
|
+
# add_typedcl(...) => TYPEDCL(...)
|
|
214
|
+
#
|
|
215
|
+
# === PARAMETER
|
|
216
|
+
# _location_:: Location -- Location where the declaration appears.
|
|
217
|
+
# _typedcl_type_:: String -- Type declaration type.
|
|
218
|
+
# _type_name_:: String -- Type name.
|
|
219
|
+
# _type_rep_:: String -- Type representation string.
|
|
220
|
+
#
|
|
221
|
+
# === RETURN VALUE
|
|
222
|
+
# None.
|
|
223
|
+
def add_typedcl(location, typedcl_type, type_name, type_rep)
|
|
224
|
+
add_code_struct(TypeDcl.new(location, typedcl_type, type_name, type_rep))
|
|
225
|
+
end
|
|
226
|
+
alias :TYPEDCL :add_typedcl
|
|
227
|
+
module_function :add_typedcl, :TYPEDCL
|
|
228
|
+
|
|
229
|
+
# === DESCRIPTION
|
|
230
|
+
# Adds global variable decaration information to the report.
|
|
231
|
+
#
|
|
232
|
+
# Abbreviation below is available.
|
|
233
|
+
# add_gvardcl(...) => GVARDCL(...)
|
|
234
|
+
#
|
|
235
|
+
# === PARAMETER
|
|
236
|
+
# _location_:: Location -- Location where the declaration appears.
|
|
237
|
+
# _variable_name_:: String -- Global variable name.
|
|
238
|
+
# _type_rep_:: String -- Type representation string.
|
|
239
|
+
#
|
|
240
|
+
# === RETURN VALUE
|
|
241
|
+
# None.
|
|
242
|
+
def add_gvardcl(location, variable_name, type_rep)
|
|
243
|
+
add_code_struct(GVarDcl.new(location, variable_name, type_rep))
|
|
244
|
+
end
|
|
245
|
+
alias :GVARDCL :add_gvardcl
|
|
246
|
+
module_function :add_gvardcl, :GVARDCL
|
|
247
|
+
|
|
248
|
+
# === DESCRIPTION
|
|
249
|
+
# Adds function declaration information to the report.
|
|
250
|
+
#
|
|
251
|
+
# Abbreviation below is available.
|
|
252
|
+
# add_funcdcl(...) => FUNCDCL(...)
|
|
253
|
+
#
|
|
254
|
+
# === PARAMETER
|
|
255
|
+
# _location_:: Location -- Location where the declaration appears.
|
|
256
|
+
# _function_linkage_type_:: String -- Function linkage type string.
|
|
257
|
+
# _function_scope_type_:: String -- Declaration scope type string.
|
|
258
|
+
# _function_identifier_:: String -- Function identifier.
|
|
259
|
+
#
|
|
260
|
+
# === RETURN VALUE
|
|
261
|
+
# None.
|
|
262
|
+
def add_funcdcl(location, function_linkage_type, function_scope_type,
|
|
263
|
+
function_identifier)
|
|
264
|
+
add_code_struct(FuncDcl.new(location, function_linkage_type,
|
|
265
|
+
function_scope_type, function_identifier))
|
|
266
|
+
end
|
|
267
|
+
alias :FUNCDCL :add_funcdcl
|
|
268
|
+
module_function :add_funcdcl, :FUNCDCL
|
|
269
|
+
|
|
270
|
+
# === DESCRIPTION
|
|
271
|
+
# Adds variable definition information to the report.
|
|
272
|
+
#
|
|
273
|
+
# Abbreviation below is available.
|
|
274
|
+
# add_vardef(...) => VARDEF(...)
|
|
275
|
+
#
|
|
276
|
+
# === PARAMETER
|
|
277
|
+
# _location_:: Location -- Location where the definition appears.
|
|
278
|
+
# _var_linkage_type_:: String -- Variable linkage type string.
|
|
279
|
+
# _var_scope_type_:: String -- Variable scope type string.
|
|
280
|
+
# _storage_class_type_:: String -- Variable storage class type.
|
|
281
|
+
# _variable_name_:: String -- Variable name.
|
|
282
|
+
# _type_rep_:: String -- Variable type representation string.
|
|
283
|
+
#
|
|
284
|
+
# === RETURN VALUE
|
|
285
|
+
# None.
|
|
286
|
+
def add_vardef(location, var_linkage_type, var_scope_type,
|
|
287
|
+
storage_class_type, variable_name, type_rep)
|
|
288
|
+
add_code_struct(VarDef.new(location, var_linkage_type, var_scope_type,
|
|
289
|
+
storage_class_type, variable_name, type_rep))
|
|
290
|
+
end
|
|
291
|
+
alias :VARDEF :add_vardef
|
|
292
|
+
module_function :add_vardef, :VARDEF
|
|
293
|
+
|
|
294
|
+
# === DESCRIPTION
|
|
295
|
+
# Adds function definition information to the report.
|
|
296
|
+
#
|
|
297
|
+
# Abbreviation below is available.
|
|
298
|
+
# add_funcdef(...) => FUNCDEF(...)
|
|
299
|
+
#
|
|
300
|
+
# === PARAMETER
|
|
301
|
+
# _location_:: Location -- Location where the definition appears.
|
|
302
|
+
# _function_linkage_type_:: String -- Function linkage type string.
|
|
303
|
+
# _function_scope_type_:: String -- Definition scope type string.
|
|
304
|
+
# _function_identifier_:: String -- Function identifier.
|
|
305
|
+
# _lines_:: Integer -- Physical lines.
|
|
306
|
+
#
|
|
307
|
+
# === RETURN VALUE
|
|
308
|
+
# None.
|
|
309
|
+
def add_funcdef(location, function_linkage_type, function_scope_type,
|
|
310
|
+
function_identifier, lines)
|
|
311
|
+
add_code_struct(FuncDef.new(location, function_linkage_type,
|
|
312
|
+
function_scope_type, function_identifier,
|
|
313
|
+
lines))
|
|
314
|
+
end
|
|
315
|
+
alias :FUNCDEF :add_funcdef
|
|
316
|
+
module_function :add_funcdef, :FUNCDEF
|
|
317
|
+
|
|
318
|
+
# === DESCRIPTION
|
|
319
|
+
# Adds macro definition information to the report.
|
|
320
|
+
#
|
|
321
|
+
# Abbreviation below is available.
|
|
322
|
+
# add_macrodef(...) => MACRODEF(...)
|
|
323
|
+
#
|
|
324
|
+
# === PARAMETER
|
|
325
|
+
# _location_:: Location -- Location where the definition appears.
|
|
326
|
+
# _macro_name_:: String -- Macro name.
|
|
327
|
+
# _macro_type_:: String -- Macro type string.
|
|
328
|
+
#
|
|
329
|
+
# === RETURN VALUE
|
|
330
|
+
# None.
|
|
331
|
+
def add_macrodef(location, macro_name, macro_type)
|
|
332
|
+
add_code_struct(MacroDef.new(location, macro_name, macro_type))
|
|
333
|
+
end
|
|
334
|
+
alias :MACRODEF :add_macrodef
|
|
335
|
+
module_function :add_macrodef, :MACRODEF
|
|
336
|
+
|
|
337
|
+
# === DESCRIPTION
|
|
338
|
+
# Adds label definition information to the report.
|
|
339
|
+
#
|
|
340
|
+
# Abbreviation below is available.
|
|
341
|
+
# add_labeldef(...) => LABELDEF(...)
|
|
342
|
+
#
|
|
343
|
+
# === PARAMETER
|
|
344
|
+
# _location_:: Location -- Location where the definition appears.
|
|
345
|
+
# _label_name_:: String -- Label name.
|
|
346
|
+
#
|
|
347
|
+
# === RETURN VALUE
|
|
348
|
+
# None.
|
|
349
|
+
def add_labeldef(location, label_name)
|
|
350
|
+
add_code_struct(LabelDef.new(location, label_name))
|
|
351
|
+
end
|
|
352
|
+
alias :LABELDEF :add_labeldef
|
|
353
|
+
module_function :add_labeldef, :LABELDEF
|
|
354
|
+
|
|
355
|
+
# === DESCRIPTION
|
|
356
|
+
# Adds initialization information to the report.
|
|
357
|
+
#
|
|
358
|
+
# Abbreviation below is available.
|
|
359
|
+
# add_initialization(...) => INITIALIZATION(...)
|
|
360
|
+
#
|
|
361
|
+
# === PARAMETER
|
|
362
|
+
# _location_:: Location -- Location where the variable appears.
|
|
363
|
+
# _variable_name_:: String -- Initialized variable name.
|
|
364
|
+
# _initializer_rep_:: String -- Initializer representation.
|
|
365
|
+
#
|
|
366
|
+
# === RETURN VALUE
|
|
367
|
+
# None.
|
|
368
|
+
def add_initialization(location, variable_name, initializer_rep)
|
|
369
|
+
add_code_struct(Initialization.new(location, variable_name,
|
|
370
|
+
initializer_rep))
|
|
371
|
+
end
|
|
372
|
+
alias :INITIALIZATION :add_initialization
|
|
373
|
+
module_function :add_initialization, :INITIALIZATION
|
|
374
|
+
|
|
375
|
+
# === DESCRIPTION
|
|
376
|
+
# Adds assignment information to the report.
|
|
377
|
+
#
|
|
378
|
+
# Abbreviation below is available.
|
|
379
|
+
# add_assignment(...) => ASSIGNMENT(...)
|
|
380
|
+
#
|
|
381
|
+
# === PARAMETER
|
|
382
|
+
# _location_:: Location -- Location where the variable appears.
|
|
383
|
+
# _variable_name_:: String -- Assigned variable name.
|
|
384
|
+
# _assignment_rep_:: String -- Assignment expression representation.
|
|
385
|
+
#
|
|
386
|
+
# === RETURN VALUE
|
|
387
|
+
# None.
|
|
388
|
+
def add_assignment(location, variable_name, assignment_rep)
|
|
389
|
+
add_code_struct(Assignment.new(location, variable_name,
|
|
390
|
+
assignment_rep))
|
|
391
|
+
end
|
|
392
|
+
alias :ASSIGNMENT :add_assignment
|
|
393
|
+
module_function :add_assignment, :ASSIGNMENT
|
|
394
|
+
|
|
395
|
+
# === DESCRIPTION
|
|
396
|
+
# Adds header include information to the report.
|
|
397
|
+
#
|
|
398
|
+
# Abbreviation below is available.
|
|
399
|
+
# add_include(...) => INCLUDE(...)
|
|
400
|
+
#
|
|
401
|
+
# === PARAMETER
|
|
402
|
+
# _location_:: Location -- Location where the directive appears.
|
|
403
|
+
# _included_fpath_:: Pathname -- Path name of the included file.
|
|
404
|
+
#
|
|
405
|
+
# === RETURN VALUE
|
|
406
|
+
# None.
|
|
407
|
+
def add_include(location, included_fpath)
|
|
408
|
+
add_code_struct(Include.new(location, included_fpath))
|
|
409
|
+
end
|
|
410
|
+
alias :INCLUDE :add_include
|
|
411
|
+
module_function :add_include, :INCLUDE
|
|
412
|
+
|
|
413
|
+
# === DESCRIPTION
|
|
414
|
+
# Adds function call information to the report.
|
|
415
|
+
#
|
|
416
|
+
# Abbreviation below is available.
|
|
417
|
+
# add_call(...) => CALL(...)
|
|
418
|
+
#
|
|
419
|
+
# === PARAMETER
|
|
420
|
+
# _location_:: Location -- Location where the function call appears.
|
|
421
|
+
# _caller_function_:: FunctionIdentifier -- Calling function identifier.
|
|
422
|
+
# _callee_function_:: FunctionIdentifier -- Called function identifier.
|
|
423
|
+
def add_call(location, caller_function, callee_function)
|
|
424
|
+
add_code_struct(Call.new(location, caller_function, callee_function))
|
|
425
|
+
end
|
|
426
|
+
alias :CALL :add_call
|
|
427
|
+
module_function :add_call, :CALL
|
|
428
|
+
|
|
429
|
+
# === DESCRIPTION
|
|
430
|
+
# Adds variable cross reference information to the report.
|
|
431
|
+
#
|
|
432
|
+
# Abbreviation below is available.
|
|
433
|
+
# add_xref_variable(...) => XREF_VAR(...)
|
|
434
|
+
#
|
|
435
|
+
# === PARAMETER
|
|
436
|
+
# _location_:: Location -- Location where the cross-ref appears.
|
|
437
|
+
# _accessor_function_:: FunctionIdentifier -- Accessing function
|
|
438
|
+
# identifier.
|
|
439
|
+
# _access_type_:: String -- Access type string.
|
|
440
|
+
# _accessee_variable_:: String -- Accessed variable name.
|
|
441
|
+
#
|
|
442
|
+
# === RETURN VALUE
|
|
443
|
+
# None.
|
|
444
|
+
def add_xref_variable(location, accessor_function, access_type,
|
|
445
|
+
accessee_variable)
|
|
446
|
+
add_code_struct(XRefVar.new(location, accessor_function, access_type,
|
|
447
|
+
accessee_variable))
|
|
448
|
+
end
|
|
449
|
+
alias :XREF_VAR :add_xref_variable
|
|
450
|
+
module_function :add_xref_variable, :XREF_VAR
|
|
451
|
+
|
|
452
|
+
# === DESCRIPTION
|
|
453
|
+
# Adds function cross reference information to the report.
|
|
454
|
+
#
|
|
455
|
+
# Abbreviation below is available.
|
|
456
|
+
# add_xref_function(...) => XREF_FUNC(...)
|
|
457
|
+
#
|
|
458
|
+
# === PARAMETER
|
|
459
|
+
# _location_:: Location -- Location where the cross-ref appears.
|
|
460
|
+
# _accessor_function_:: FunctionIdentifier -- Accessing function
|
|
461
|
+
# identifier.
|
|
462
|
+
# _access_type_:: String -- Access type string.
|
|
463
|
+
# _accessee_function_:: FunctionIdentifier -- Accessed function identifier.
|
|
464
|
+
#
|
|
465
|
+
# === RETURN VALUE
|
|
466
|
+
# None.
|
|
467
|
+
def add_xref_function(location, accessor_function, access_type,
|
|
468
|
+
accessee_function)
|
|
469
|
+
add_code_struct(XRefFunc.new(location, accessor_function, access_type,
|
|
470
|
+
accessee_function))
|
|
471
|
+
end
|
|
472
|
+
alias :XREF_FUNC :add_xref_function
|
|
473
|
+
module_function :add_xref_function, :XREF_FUNC
|
|
474
|
+
|
|
475
|
+
def add_literal(location, literal_type, literal_prefix, literal_suffix,
|
|
476
|
+
literal_value)
|
|
477
|
+
add_code_struct(Literal.new(location, literal_type, literal_prefix,
|
|
478
|
+
literal_suffix, literal_value))
|
|
479
|
+
end
|
|
480
|
+
alias :LIT :add_literal
|
|
481
|
+
module_function :add_literal, :LIT
|
|
482
|
+
|
|
483
|
+
def add_pp_directive(location, pp_directive, pp_tokens)
|
|
484
|
+
add_code_struct(PPDirective.new(location, pp_directive, pp_tokens))
|
|
485
|
+
end
|
|
486
|
+
alias :PP_DIRECTIVE :add_pp_directive
|
|
487
|
+
module_function :add_pp_directive, :PP_DIRECTIVE
|
|
488
|
+
|
|
489
|
+
# === DESCRIPTION
|
|
490
|
+
# Adds code structure information to the report.
|
|
491
|
+
#
|
|
492
|
+
# === PARAMETER
|
|
493
|
+
# _code_struct_:: CodeStructure -- Code structure information to be added.
|
|
494
|
+
#
|
|
495
|
+
# === RETURN VALUE
|
|
496
|
+
# None.
|
|
497
|
+
def add_code_struct(code_struct)
|
|
498
|
+
report.add_code_struct(code_struct)
|
|
499
|
+
nil
|
|
500
|
+
end
|
|
501
|
+
module_function :add_code_struct
|
|
502
|
+
|
|
503
|
+
def add_FL_STMT(fpath, statement_count)
|
|
504
|
+
add_code_metric(FL_STMT_Metric.new(fpath, statement_count))
|
|
505
|
+
end
|
|
506
|
+
alias :FL_STMT :add_FL_STMT
|
|
507
|
+
module_function :add_FL_STMT, :FL_STMT
|
|
508
|
+
|
|
509
|
+
def add_FL_FUNC(fpath, function_count)
|
|
510
|
+
add_code_metric(FL_FUNC_Metric.new(fpath, function_count))
|
|
511
|
+
end
|
|
512
|
+
alias :FL_FUNC :add_FL_FUNC
|
|
513
|
+
module_function :add_FL_FUNC, :FL_FUNC
|
|
514
|
+
|
|
515
|
+
def add_FN_STMT(function_identifier, location, statement_count)
|
|
516
|
+
add_code_metric(FN_STMT_Metric.new(function_identifier, location,
|
|
517
|
+
statement_count))
|
|
518
|
+
end
|
|
519
|
+
alias :FN_STMT :add_FN_STMT
|
|
520
|
+
module_function :add_FN_STMT, :FN_STMT
|
|
521
|
+
|
|
522
|
+
def add_FN_UNRC(function_identifier, location, unreached_statement_count)
|
|
523
|
+
add_code_metric(FN_UNRC_Metric.new(function_identifier, location,
|
|
524
|
+
unreached_statement_count))
|
|
525
|
+
end
|
|
526
|
+
alias :FN_UNRC :add_FN_UNRC
|
|
527
|
+
module_function :add_FN_UNRC, :FN_UNRC
|
|
528
|
+
|
|
529
|
+
def add_FN_LINE(function_identifier, location, total_lines)
|
|
530
|
+
add_code_metric(FN_LINE_Metric.new(function_identifier, location,
|
|
531
|
+
total_lines))
|
|
532
|
+
end
|
|
533
|
+
alias :FN_LINE :add_FN_LINE
|
|
534
|
+
module_function :add_FN_LINE, :FN_LINE
|
|
535
|
+
|
|
536
|
+
def add_FN_PARA(function_identifier, location, parameter_count)
|
|
537
|
+
add_code_metric(FN_PARA_Metric.new(function_identifier, location,
|
|
538
|
+
parameter_count))
|
|
539
|
+
end
|
|
540
|
+
alias :FN_PARA :add_FN_PARA
|
|
541
|
+
module_function :add_FN_PARA, :FN_PARA
|
|
542
|
+
|
|
543
|
+
def add_FN_UNUV(function_identifier, location, useless_variable_count)
|
|
544
|
+
add_code_metric(FN_UNUV_Metric.new(function_identifier, location,
|
|
545
|
+
useless_variable_count))
|
|
546
|
+
end
|
|
547
|
+
alias :FN_UNUV :add_FN_UNUV
|
|
548
|
+
module_function :add_FN_UNUV, :FN_UNUV
|
|
549
|
+
|
|
550
|
+
def add_FN_CSUB(function_identifier, location, function_call_count)
|
|
551
|
+
add_code_metric(FN_CSUB_Metric.new(function_identifier, location,
|
|
552
|
+
function_call_count))
|
|
553
|
+
end
|
|
554
|
+
alias :FN_CSUB :add_FN_CSUB
|
|
555
|
+
module_function :add_FN_CSUB, :FN_CSUB
|
|
556
|
+
|
|
557
|
+
def add_FN_GOTO(function_identifier, location, goto_count)
|
|
558
|
+
add_code_metric(FN_GOTO_Metric.new(function_identifier, location,
|
|
559
|
+
goto_count))
|
|
560
|
+
end
|
|
561
|
+
alias :FN_GOTO :add_FN_GOTO
|
|
562
|
+
module_function :add_FN_GOTO, :FN_GOTO
|
|
563
|
+
|
|
564
|
+
def add_FN_RETN(function_identifier, location, return_count)
|
|
565
|
+
add_code_metric(FN_RETN_Metric.new(function_identifier, location,
|
|
566
|
+
return_count))
|
|
567
|
+
end
|
|
568
|
+
alias :FN_RETN :add_FN_RETN
|
|
569
|
+
module_function :add_FN_RETN, :FN_RETN
|
|
570
|
+
|
|
571
|
+
def add_FN_UELS(function_identifier, location, if_statement_count)
|
|
572
|
+
add_code_metric(FN_UELS_Metric.new(function_identifier, location,
|
|
573
|
+
if_statement_count))
|
|
574
|
+
end
|
|
575
|
+
alias :FN_UELS :add_FN_UELS
|
|
576
|
+
module_function :add_FN_UELS, :FN_UELS
|
|
577
|
+
|
|
578
|
+
def add_FN_NEST(function_identifier, location, max_nest_level)
|
|
579
|
+
add_code_metric(FN_NEST_Metric.new(function_identifier, location,
|
|
580
|
+
max_nest_level))
|
|
581
|
+
end
|
|
582
|
+
alias :FN_NEST :add_FN_NEST
|
|
583
|
+
module_function :add_FN_NEST, :FN_NEST
|
|
584
|
+
|
|
585
|
+
def add_FN_PATH(function_identifier, location, path_count)
|
|
586
|
+
add_code_metric(FN_PATH_Metric.new(function_identifier, location,
|
|
587
|
+
path_count))
|
|
588
|
+
end
|
|
589
|
+
alias :FN_PATH :add_FN_PATH
|
|
590
|
+
module_function :add_FN_PATH, :FN_PATH
|
|
591
|
+
|
|
592
|
+
def add_FN_CYCM(function_identifier, location, cyclomatic_complexity)
|
|
593
|
+
add_code_metric(FN_CYCM_Metric.new(function_identifier, location,
|
|
594
|
+
cyclomatic_complexity))
|
|
595
|
+
end
|
|
596
|
+
alias :FN_CYCM :add_FN_CYCM
|
|
597
|
+
module_function :add_FN_CYCM, :FN_CYCM
|
|
598
|
+
|
|
599
|
+
def add_FN_CALL(function_signature, location, caller_count)
|
|
600
|
+
add_code_metric(FN_CALL_Metric.new(function_signature, location,
|
|
601
|
+
caller_count))
|
|
602
|
+
end
|
|
603
|
+
alias :FN_CALL :add_FN_CALL
|
|
604
|
+
module_function :add_FN_CALL, :FN_CALL
|
|
605
|
+
|
|
606
|
+
def add_code_metric(code_metric)
|
|
607
|
+
report.add_code_metric(code_metric)
|
|
608
|
+
nil
|
|
609
|
+
end
|
|
610
|
+
module_function :add_code_metric
|
|
611
|
+
end
|
|
612
|
+
|
|
613
|
+
CodeExtraction.class_eval { include ReportUtil }
|
|
614
|
+
MessageDetection.class_eval { extend MessageUniqueness; include ReportUtil }
|
|
615
|
+
MetricMeasurement.class_eval { include ReportUtil }
|
|
616
|
+
|
|
617
|
+
end
|