module AdLint::ReportUtil

Public Instance Methods

ASSIGNMENT(loc, var_name, assign_rep)
Alias for: write_assignment
C(msg_name, loc, *parts)
E(msg_name, loc, *parts)
Alias for: write_error_message
FL_FUNC(fpath, fun_cnt)
Alias for: write_FL_FUNC
FL_STMT(fpath, stmt_cnt)
Alias for: write_FL_STMT
FN_CALL(fun_sig, loc, caller_cnt)
Alias for: write_FN_CALL
FN_CSUB(fun_id, loc, funcall_cnt)
Alias for: write_FN_CSUB
FN_CYCM(fun_id, loc, cycl_compl)
Alias for: write_FN_CYCM
FN_GOTO(fun_id, loc, goto_cnt)
Alias for: write_FN_GOTO
FN_LINE(fun_id, loc, fun_lines)
Alias for: write_FN_LINE
FN_NEST(fun_id, loc, max_nest)
Alias for: write_FN_NEST
FN_PARA(fun_id, loc, param_cnt)
Alias for: write_FN_PARA
FN_PATH(fun_id, loc, path_cnt)
Alias for: write_FN_PATH
FN_RETN(fun_id, loc, ret_cnt)
Alias for: write_FN_RETN
FN_STMT(fun_id, loc, stmt_cnt)
Alias for: write_FN_STMT
FN_UELS(fun_id, loc, if_stmt_cnt)
Alias for: write_FN_UELS
FN_UNRC(fun_id, loc, unreached_stmt_cnt)
Alias for: write_FN_UNRC
FN_UNUV(fun_id, loc, useless_var_cnt)
Alias for: write_FN_UNUV
FUNCALL(loc, caller_fun, callee_fun)
Alias for: write_funcall
FUNDCL(loc, linkage, scope_type, dcl_type, fun_id)
Alias for: write_fundcl
FUNDEF(loc, linkage, scope_type, fun_id, lines)
Alias for: write_fundef
GVARDCL(loc, var_name, type_rep)
Alias for: write_gvardcl
INCLUDE(loc, fpath)
Alias for: write_include
INITIALIZATION(loc, var_name, init_rep)
LABELDEF(loc, label_name)
Alias for: write_labeldef
LIT(loc, lit_type, prefix, suffix, value)
Alias for: write_literal
MACRODEF(loc, macro_name, macro_type)
Alias for: write_macrodef
PP_DIRECTIVE(loc, pp_dire, pp_tokens)
Alias for: write_pp_directive
TYPEDCL(loc, dcl_type, type_name, type_rep)
Alias for: write_typedcl
VARDEF(loc, linkage, scope_type, sc_type, var_name, type_rep)
Alias for: write_vardef
W(*args)
XREF_FUN(loc, referrer, ref_type, fun)
Alias for: write_xref_function
XREF_VAR(loc, referrer, ref_type, var_name)
Alias for: write_xref_variable
create_context_message(msg_name, loc, *parts) click to toggle source

DESCRIPTION

Creates a context message.

Abbreviation below is available.

create_context_message(msg_name, loc, ...) => C(msg_name, loc, ...)

PARAMETER

msg_name

SymbolMessage name.

loc

LocationLocation where the message points to.

parts

Array< Object > – Message formatting parts.

RETURN VALUE

ContextMessage – New context message.

# File lib/adlint/report.rb, line 205
def create_context_message(msg_name, loc, *parts)
  ContextMessage.new(message_catalog, msg_name, self.class, loc, *parts)
end
Also aliased as: C
write_FL_FUNC(fpath, fun_cnt) click to toggle source
# File lib/adlint/report.rb, line 465
def write_FL_FUNC(fpath, fun_cnt)
  write_code_metric(FL_FUNC_Metric.new(fpath, fun_cnt))
end
Also aliased as: FL_FUNC
write_FL_STMT(fpath, stmt_cnt) click to toggle source
# File lib/adlint/report.rb, line 460
def write_FL_STMT(fpath, stmt_cnt)
  write_code_metric(FL_STMT_Metric.new(fpath, stmt_cnt))
end
Also aliased as: FL_STMT
write_FN_CALL(fun_sig, loc, caller_cnt) click to toggle source
# File lib/adlint/report.rb, line 530
def write_FN_CALL(fun_sig, loc, caller_cnt)
  write_code_metric(FN_CALL_Metric.new(fun_sig, loc, caller_cnt))
end
Also aliased as: FN_CALL
write_FN_CSUB(fun_id, loc, funcall_cnt) click to toggle source
# File lib/adlint/report.rb, line 495
def write_FN_CSUB(fun_id, loc, funcall_cnt)
  write_code_metric(FN_CSUB_Metric.new(fun_id, loc, funcall_cnt))
end
Also aliased as: FN_CSUB
write_FN_CYCM(fun_id, loc, cycl_compl) click to toggle source
# File lib/adlint/report.rb, line 525
def write_FN_CYCM(fun_id, loc, cycl_compl)
  write_code_metric(FN_CYCM_Metric.new(fun_id, loc, cycl_compl))
end
Also aliased as: FN_CYCM
write_FN_GOTO(fun_id, loc, goto_cnt) click to toggle source
# File lib/adlint/report.rb, line 500
def write_FN_GOTO(fun_id, loc, goto_cnt)
  write_code_metric(FN_GOTO_Metric.new(fun_id, loc, goto_cnt))
end
Also aliased as: FN_GOTO
write_FN_LINE(fun_id, loc, fun_lines) click to toggle source
# File lib/adlint/report.rb, line 480
def write_FN_LINE(fun_id, loc, fun_lines)
  write_code_metric(FN_LINE_Metric.new(fun_id, loc, fun_lines))
end
Also aliased as: FN_LINE
write_FN_NEST(fun_id, loc, max_nest) click to toggle source
# File lib/adlint/report.rb, line 515
def write_FN_NEST(fun_id, loc, max_nest)
  write_code_metric(FN_NEST_Metric.new(fun_id, loc, max_nest))
end
Also aliased as: FN_NEST
write_FN_PARA(fun_id, loc, param_cnt) click to toggle source
# File lib/adlint/report.rb, line 485
def write_FN_PARA(fun_id, loc, param_cnt)
  write_code_metric(FN_PARA_Metric.new(fun_id, loc, param_cnt))
end
Also aliased as: FN_PARA
write_FN_PATH(fun_id, loc, path_cnt) click to toggle source
# File lib/adlint/report.rb, line 520
def write_FN_PATH(fun_id, loc, path_cnt)
  write_code_metric(FN_PATH_Metric.new(fun_id, loc, path_cnt))
end
Also aliased as: FN_PATH
write_FN_RETN(fun_id, loc, ret_cnt) click to toggle source
# File lib/adlint/report.rb, line 505
def write_FN_RETN(fun_id, loc, ret_cnt)
  write_code_metric(FN_RETN_Metric.new(fun_id, loc, ret_cnt))
end
Also aliased as: FN_RETN
write_FN_STMT(fun_id, loc, stmt_cnt) click to toggle source
# File lib/adlint/report.rb, line 470
def write_FN_STMT(fun_id, loc, stmt_cnt)
  write_code_metric(FN_STMT_Metric.new(fun_id, loc, stmt_cnt))
end
Also aliased as: FN_STMT
write_FN_UELS(fun_id, loc, if_stmt_cnt) click to toggle source
# File lib/adlint/report.rb, line 510
def write_FN_UELS(fun_id, loc, if_stmt_cnt)
  write_code_metric(FN_UELS_Metric.new(fun_id, loc, if_stmt_cnt))
end
Also aliased as: FN_UELS
write_FN_UNRC(fun_id, loc, unreached_stmt_cnt) click to toggle source
# File lib/adlint/report.rb, line 475
def write_FN_UNRC(fun_id, loc, unreached_stmt_cnt)
  write_code_metric(FN_UNRC_Metric.new(fun_id, loc, unreached_stmt_cnt))
end
Also aliased as: FN_UNRC
write_FN_UNUV(fun_id, loc, useless_var_cnt) click to toggle source
# File lib/adlint/report.rb, line 490
def write_FN_UNUV(fun_id, loc, useless_var_cnt)
  write_code_metric(FN_UNUV_Metric.new(fun_id, loc, useless_var_cnt))
end
Also aliased as: FN_UNUV
write_assignment(loc, var_name, assign_rep) click to toggle source

DESCRIPTION

Writes an assignment information on the report.

Abbreviation below is available.

write_assignment(...) => ASSIGNMENT(...)

PARAMETER

loc

LocationLocation where the variable appears.

var_name

String – Assigned variable name.

assign_rep

StringString representation of the assignment.

RETURN VALUE

None.

# File lib/adlint/report.rb, line 375
def write_assignment(loc, var_name, assign_rep)
  write_code_struct(Assignment.new(loc, var_name, assign_rep))
end
Also aliased as: ASSIGNMENT
write_error_message(msg_name, loc, *parts) click to toggle source

DESCRIPTION

Writes an error message on the report.

Abbreviation below is available.

write_error_message(msg_name, loc, ...) => E(msg_name, loc, ...)

PARAMETER

msg_name

SymbolMessage name.

loc

LocationLocation where the message points to.

parts

Array< Object > – Message formatting parts.

RETURN VALUE

None.

# File lib/adlint/report.rb, line 155
def write_error_message(msg_name, loc, *parts)
  report.write_message(
    ErrorMessage.new(message_catalog, msg_name, loc, *parts))
end
Also aliased as: E
write_funcall(loc, caller_fun, callee_fun) click to toggle source

DESCRIPTION

Writes a function call information on the report.

Abbreviation below is available.

write_funcall(...) => FUNCALL(...)

PARAMETER

loc

LocationLocation where the function call appears.

caller_fun

FunctionId – Calling function identifier.

callee_fun

FunctionId – Called function identifier.

# File lib/adlint/report.rb, line 407
def write_funcall(loc, caller_fun, callee_fun)
  write_code_struct(Funcall.new(loc, caller_fun, callee_fun))
end
Also aliased as: FUNCALL
write_fundcl(loc, linkage, scope_type, dcl_type, fun_id) click to toggle source

DESCRIPTION

Writes a function declaration information on the report.

Abbreviation below is available.

write_fundcl(...) => FUNDCL(...)

PARAMETER

loc

LocationLocation where the declaration appears.

linkage

String – Function linkage type string.

scope_type

String – Declaration scope type string.

dcl_type

String – Declaration type string.

fun_id

FunctionId – Identifier of the function.

RETURN VALUE

None.

# File lib/adlint/report.rb, line 262
def write_fundcl(loc, linkage, scope_type, dcl_type, fun_id)
  write_code_struct(FunDcl.new(loc, linkage, scope_type, dcl_type, fun_id))
end
Also aliased as: FUNDCL
write_fundef(loc, linkage, scope_type, fun_id, lines) click to toggle source

DESCRIPTION

Writes a function definition information on the report.

Abbreviation below is available.

write_fundef(...) => FUNDEF(...)

PARAMETER

loc

LocationLocation where the definition appears.

linkage

String – Function linkage type string.

scope_type

String – Definition scope type string.

fun_id

FunctionId – Identifier of the function.

lines

Integer – Physical lines.

RETURN VALUE

None.

# File lib/adlint/report.rb, line 304
def write_fundef(loc, linkage, scope_type, fun_id, lines)
  write_code_struct(FunDef.new(loc, linkage, scope_type, fun_id, lines))
end
Also aliased as: FUNDEF
write_gvardcl(loc, var_name, type_rep) click to toggle source

DESCRIPTION

Writes a global variable decaration information on the report.

Abbreviation below is available.

write_gvardcl(...) => GVARDCL(...)

PARAMETER

loc

LocationLocation where the declaration appears.

var_name

String – Global variable name.

type_rep

String – Type representation string.

RETURN VALUE

None.

# File lib/adlint/report.rb, line 242
def write_gvardcl(loc, var_name, type_rep)
  write_code_struct(GVarDcl.new(loc, var_name, type_rep))
end
Also aliased as: GVARDCL
write_include(loc, fpath) click to toggle source

DESCRIPTION

Writes a header include information on the report.

Abbreviation below is available.

write_include(...) => INCLUDE(...)

PARAMETER

loc

LocationLocation where the directive appears.

fpath

Pathname – Path name of the included file.

RETURN VALUE

None.

# File lib/adlint/report.rb, line 392
def write_include(loc, fpath)
  write_code_struct(Include.new(loc, fpath))
end
Also aliased as: INCLUDE
write_initialization(loc, var_name, init_rep) click to toggle source

DESCRIPTION

Writes an initialization information on the report.

Abbreviation below is available.

write_initialization(...) => INITIALIZATION(...)

PARAMETER

loc

LocationLocation where the variable appears.

var_name

String – Initialized variable name.

init_rep

StringString representation of the initializer.

RETURN VALUE

None.

# File lib/adlint/report.rb, line 357
def write_initialization(loc, var_name, init_rep)
  write_code_struct(Initialization.new(loc, var_name, init_rep))
end
Also aliased as: INITIALIZATION
write_labeldef(loc, label_name) click to toggle source

DESCRIPTION

Writes a label definition information on the report.

Abbreviation below is available.

write_labeldef(...) => LABELDEF(...)

PARAMETER

loc

LocationLocation where the definition appears.

label_name

String – Label name.

RETURN VALUE

None.

# File lib/adlint/report.rb, line 339
def write_labeldef(loc, label_name)
  write_code_struct(LabelDef.new(loc, label_name))
end
Also aliased as: LABELDEF
write_literal(loc, lit_type, prefix, suffix, value) click to toggle source
# File lib/adlint/report.rb, line 450
def write_literal(loc, lit_type, prefix, suffix, value)
  write_code_struct(Literal.new(loc, lit_type, prefix, suffix, value))
end
Also aliased as: LIT
write_macrodef(loc, macro_name, macro_type) click to toggle source

DESCRIPTION

Writes a macro definition information on the report.

Abbreviation below is available.

write_macrodef(...) => MACRODEF(...)

PARAMETER

loc

LocationLocation where the definition appears.

macro_name

String – Macro name.

macro_type

String – Macro type string.

RETURN VALUE

None.

# File lib/adlint/report.rb, line 322
def write_macrodef(loc, macro_name, macro_type)
  write_code_struct(MacroDef.new(loc, macro_name, macro_type))
end
Also aliased as: MACRODEF
write_pp_directive(loc, pp_dire, pp_tokens) click to toggle source
# File lib/adlint/report.rb, line 455
def write_pp_directive(loc, pp_dire, pp_tokens)
  write_code_struct(PPDirective.new(loc, pp_dire, pp_tokens))
end
Also aliased as: PP_DIRECTIVE
write_typedcl(loc, dcl_type, type_name, type_rep) click to toggle source

DESCRIPTION

Writes a type declaration information on the report.

Abbreviation below is available.

write_typedcl(...) => TYPEDCL(...)

PARAMETER

loc

LocationLocation where the declaration appears.

dcl_type

String – Type declaration type.

type_name

String – Type name.

type_rep

String – Type representation string.

RETURN VALUE

None.

# File lib/adlint/report.rb, line 224
def write_typedcl(loc, dcl_type, type_name, type_rep)
  write_code_struct(TypeDcl.new(loc, dcl_type, type_name, type_rep))
end
Also aliased as: TYPEDCL
write_vardef(loc, linkage, scope_type, sc_type, var_name, type_rep) click to toggle source

DESCRIPTION

Writes a variable definition information on the report.

Abbreviation below is available.

write_vardef(...) => VARDEF(...)

PARAMETER

loc

LocationLocation where the definition appears.

linkage_type

String – Variable linkage type string.

scope_type

String – Variable scope type string.

sc_type

String – Variable storage class type.

var_name

String – Variable name.

type_rep

String – Variable type representation string.

RETURN VALUE

None.

# File lib/adlint/report.rb, line 283
def write_vardef(loc, linkage, scope_type, sc_type, var_name, type_rep)
  write_code_struct(VarDef.new(loc, linkage, scope_type, sc_type, var_name,
                               type_rep))
end
Also aliased as: VARDEF
write_warning_message(*args) click to toggle source

DESCRIPTION

Writes a warning message on the report.

Abbreviation below is available.

write_warning_message(loc, ...) => W(loc, ...)

PARAMETER

loc

LocationLocation where the message points to.

RETURN VALUE

None.

# File lib/adlint/report.rb, line 172
def write_warning_message(*args)
  check_class = self.class
  check_class = check_class.outer_module until check_class < CodeCheck

  head_msg = nil
  args.chunk { |arg| arg.kind_of?(Message) }.each do |*, chunk|
    case chunk.first
    when Message
      if head_msg
        chunk.each { |ctxt_msg| head_msg.complement_with(ctxt_msg) }
      end
    else
      head_msg = WarningMessage.new(message_catalog, check_class, *chunk)
    end
  end

  report.write_message(head_msg, suppressors) if head_msg
end
Also aliased as: W
write_xref_function(loc, referrer, ref_type, fun) click to toggle source

DESCRIPTION

Writes a function cross reference information on the report.

Abbreviation below is available.

write_xref_function(...) => XREF_FUN(...)

PARAMETER

loc

LocationLocation where the cross-ref appears.

referrer

FunctionId – Accessing function identifier.

ref_type

String – Access type string.

fun

FunctionId – Accessed function identifier.

RETURN VALUE

None.

# File lib/adlint/report.rb, line 445
def write_xref_function(loc, referrer, ref_type, fun)
  write_code_struct(XRefFun.new(loc, referrer, ref_type, fun))
end
Also aliased as: XREF_FUN
write_xref_variable(loc, referrer, ref_type, var_name) click to toggle source

DESCRIPTION

Writes a variable cross reference information on the report.

Abbreviation below is available.

write_xref_variable(...) => XREF_VAR(...)

PARAMETER

loc

LocationLocation where the cross-ref appears.

referrer

FunctionId – Accessing function identifier.

ref_type

String – Access type string.

var_name

String – Accessed variable name.

RETURN VALUE

None.

# File lib/adlint/report.rb, line 426
def write_xref_variable(loc, referrer, ref_type, var_name)
  write_code_struct(XRefVar.new(loc, referrer, ref_type, var_name))
end
Also aliased as: XREF_VAR

Private Instance Methods

write_code_metric(code_metric) click to toggle source
# File lib/adlint/report.rb, line 541
def write_code_metric(code_metric)
  report.write_code_metric(code_metric)
  nil
end
write_code_struct(code_struct) click to toggle source
# File lib/adlint/report.rb, line 536
def write_code_struct(code_struct)
  report.write_code_struct(code_struct)
  nil
end