codeCheck: codeCheck

Description Usage Arguments Value Author(s) See Also Examples

View source: R/codeCheck.R

Description

Checks GAMS code for consistency. Throws out warnings if something is wrong in the code and returns a list containing the interfaces of each module of the code.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
codeCheck(
  path = ".",
  modulepath = "modules",
  core_files = c("core/*.gms", "main.gms"),
  debug = FALSE,
  interactive = FALSE,
  test_switches = TRUE,
  strict = FALSE,
  details = FALSE
)

Arguments

path

path of the main folder of the model

modulepath

path to the module folder relative to "path"

core_files

list of files that belong to the core (wildcard expansion is supported)

debug

If TRUE additional information will be returned usefule for debugging the codeCheck function

interactive

activates an interactive developer mode in which some of the warnings can be fixed interactively.

test_switches

(boolean) Should realization switches in model core be tested for completness? Usually set to TRUE but should be set to FALSE for standalone models only using a subset of existing modules

strict

(boolean) test strictness. If set to TRUE warnings from codeCheck will stop calculations at the end of the analysis. Useful to enforce clean code.

details

(boolean) If activated the function will return more detailed output. Besides interface information it will provide a table containing all declarations in the code, an appearance table listing the appearance of all objects in the code and information about the existing modules. The format is list(interfaceInfo,declarations,appearance,modulesInfo). This setting will be ignored when debug is set to TRUE.

Value

A list of all modules containing the interfaces for each module. Or more detailed output if either details or debug is set to TRUE.

Author(s)

Jan Philipp Dietrich

See Also

codeExtract,readDeclarations

Examples

1
2
# check code consistency of dummy model
codeCheck(system.file("dummymodel",package="gms"))

gms documentation built on July 2, 2020, 2:36 a.m.