Schema of the Generated Database

The following sections describe the schema of the database created through the SQL backend.

Table IDS

Details of interdependant identifiers appearing in the workspace.

Field name Field type Value description
EIDINTEGER or BIGINT1Unique identifier key
NAMECHARACTER VARYINGIdentifier name
READONLYBOOLEANTrue if it appears in at least one read-only file
UNDEFMACROBOOLEANTrue if it is apparantly an undefined macro
MACROBOOLEANTrue if it a preprocessor macro
MACROARGBOOLEANTrue if it a preprocessor macro argument
ORDINARYBOOLEANTrue if it is an ordinary identifier (variable or function)
SUETAGBOOLEANTrue if it is a structure, union, or enumeration tag
SUMEMBERBOOLEANTrue if it is a structure or union member
LABELBOOLEANTrue if it is a label
TYPEDEFBOOLEANTrue if it is a typedef
ENUMBOOLEANTrue if it is an enumeration member
YACCBOOLEANTrue if it is a yacc identifier
FUNBOOLEANTrue if it is a function name
CSCOPEBOOLEANTrue if its scope is a compilation unit
LSCOPEBOOLEANTrue if it has linkage scope
UNUSEDBOOLEANTrue if it is not used

Table FILES

File details.

Field name Field type Value description
FIDINTEGERUnique file key
NAMECHARACTER VARYINGFile name
ROBOOLEANTrue if the file is read-only
NCHARINTEGERNumber of characters
NCCOMMENTINTEGERNumber of comment characters
NSPACEINTEGERNumber of space characters
NLCOMMENTINTEGERNumber of line comments
NBCOMMENTINTEGERNumber of block comments
NLINEINTEGERNumber of lines
MAXLINELENINTEGERMaximum number of characters in a line
NSTRINGINTEGERNumber of character strings
NULINEINTEGERNumber of unprocessed lines
NPPTOKENINTEGERNumber of preprocessed tokens
NCTOKENINTEGERNumber of compiled tokens
NPPDIRECTIVEINTEGERNumber of C preprocessor directives
NPPCONDINTEGERNumber of processed C preprocessor conditionals (ifdef, if, elif)
NPPFMACROINTEGERNumber of defined C preprocessor function-like macros
NPPOMACROINTEGERNumber of defined C preprocessor object-like macros
NSTATEMENTINTEGERNumber of statements
NCOPIESINTEGERNumber of copies of the file
NPFUNCTIONINTEGERNumber of defined project-scope functions
NFFUNCTIONINTEGERNumber of defined file-scope (static) functions
NPVARINTEGERNumber of defined project-scope variables
NFVARINTEGERNumber of defined file-scope (static) variables
NAGGREGATEINTEGERNumber of complete aggregate (struct/union) declarations
NAMEMBERINTEGERNumber of declared aggregate (struct/union) members
NENUMINTEGERNumber of complete enumeration declarations
NEMEMBERINTEGERNumber of declared enumeration elements
NINCFILEINTEGERNumber of directly included files

Table TOKENS

Instances of identifier tokens within the source code.

Field name Field type Value description
FIDINTEGERFile key (references FILES)
FOFFSETINTEGEROffset within the file
EIDINTEGER or BIGINT1Identifier key (references IDS)

Table COMMENTS

Comments in the code.

Field name Field type Value description
FIDINTEGERFile key (references FILES)
FOFFSETINTEGEROffset within the file
COMMENTCHARACTER VARYINGThe comment, including its delimiters

Table STRINGS

Strings in the code.

Field name Field type Value description
FIDINTEGERFile key (references FILES)
FOFFSETINTEGEROffset within the file
STRINGCHARACTER VARYINGThe string, including its delimiters

Table REST

Remaining, non-identifier source code.

Field name Field type Value description
FIDINTEGERFile key (references FILES)
FOFFSETINTEGEROffset within the file
CODECHARACTER VARYINGThe actual code

Table LINEPOS

Line number offsets within each file.

Field name Field type Value description
FIDINTEGERFile key (references FILES)
FOFFSETINTEGEROffset within the file
LNUMINTEGERLine number (starts at 1)

Table PROJECTS

Project details.

Field name Field type Value description
PIDINTEGERUnique project key
NAMECHARACTER VARYINGProject name

Table IDPROJ

Identifiers appearing in projects.

Field name Field type Value description
EIDINTEGER or BIGINT1Identifier key (references IDS)
PIDINTEGERProject key (references PROJECTS)

Table FILEPROJ

Files used in projects.

Field name Field type Value description
FIDINTEGERFile key (references FILES)
PIDINTEGERProject key (references PROJECTS)

Table DEFINERS

Included files defining required elements for a given compilation unit and project.

Field name Field type Value description
PIDINTEGERProject key (references PROJECTS)
CUIDINTEGERCompilation unit key (references FILES)
BASEFILEIDINTEGERFile (often .c) requiring (using) a definition (references FILES)
DEFINERIDINTEGERFile (often .h) providing a definition (references FILES)

Table INCLUDERS

Included files including files for a given compilation unit and project.

Field name Field type Value description
PIDINTEGERProject key (references PROJECTS)
CUIDINTEGERCompilation unit key (references FILES)
BASEFILEIDINTEGERFile included in the compilation (references FILES)
INCLUDERIDINTEGERFiles that include it (references FILES)

Table PROVIDERS

Included files providing code or data for a given compilation unit and project.

Field name Field type Value description
PIDINTEGERProject key (references PROJECTS)
CUIDINTEGERCompilation unit key (references FILES)
PROVIDERIDINTEGERIncluded file (references FILES)

Table INCTRIGGERS

Tokens requiring file inclusion for a given compilation unit and project.

Field name Field type Value description
PIDINTEGERProject key (references PROJECTS)
CUIDINTEGERCompilation unit key (references FILES)
BASEFILEIDINTEGERFile requiring a definition (references FILES)
DEFINERIDINTEGERFile providing a definition (references FILES)
FOFFSETINTEGERDefinition's offset within the providing file
LENINTEGERToken's length

Table FUNCTIONS

C functions and function-like macros.

Field name Field type Value description
IDINTEGER or BIGINT1Unique function identifier
NAMECHARACTER VARYINGFunction name (redundant; see FUNCTIONID)
ISMACROBOOLEANTrue if a function-like macro (otherwise a C function)
DEFINEDBOOLEANTrue if the function is defined within the workspace
DECLAREDBOOLEANTrue if the function is declared within the workspace
FILESCOPEDBOOLEANTrue if the function's scope is a single compilation unit (static or macro)
FIDINTEGERFile key of the function's definition, declaration, or use (references FILES)
FOFFSETINTEGEROffset of definition, declaration, or use within the file
FANININTEGERFan-in (number of callers)

Table FUNCTIONMETRICS

Metrics of defined functions and macros.

Field name Field type Value description
FUNCTIONIDINTEGER or BIGINT1Function identifier key (references FUNCTIONS)
NCHARINTEGERNumber of characters
NCCOMMENTINTEGERNumber of comment characters
NSPACEINTEGERNumber of space characters
NLCOMMENTINTEGERNumber of line comments
NBCOMMENTINTEGERNumber of block comments
NLINEINTEGERNumber of lines
MAXLINELENINTEGERMaximum number of characters in a line
NSTRINGINTEGERNumber of character strings
NULINEINTEGERNumber of unprocessed lines
NPPTOKENINTEGERNumber of preprocessed tokens
NCTOKENINTEGERNumber of compiled tokens
NPPDIRECTIVEINTEGERNumber of C preprocessor directives
NPPCONDINTEGERNumber of processed C preprocessor conditionals (ifdef, if, elif)
NPPFMACROINTEGERNumber of defined C preprocessor function-like macros
NPPOMACROINTEGERNumber of defined C preprocessor object-like macros
NSTMTINTEGERNumber of statements or declarations
NOPINTEGERNumber of operators
NUOPINTEGERNumber of unique operators
NNCONSTINTEGERNumber of numeric constants
NCLITINTEGERNumber of character literals
NIFINTEGERNumber of if statements
NELSEINTEGERNumber of else clauses
NSWITCHINTEGERNumber of switch statements
NCASEINTEGERNumber of case labels
NDEFAULTINTEGERNumber of default labels
NBREAKINTEGERNumber of break statements
NFORINTEGERNumber of for statements
NWHILEINTEGERNumber of while statements
NDOINTEGERNumber of do statements
NCONTINUEINTEGERNumber of continue statements
NGOTOINTEGERNumber of goto statements
NRETURNINTEGERNumber of return statements
NPIDINTEGERNumber of project-scope identifiers
NFIDINTEGERNumber of file-scope (static) identifiers
NMIDINTEGERNumber of macro identifiers
NIDINTEGERTotal number of object and object-like identifiers
NUPIDINTEGERNumber of unique project-scope identifiers
NUFIDINTEGERNumber of unique file-scope (static) identifiers
NUMIDINTEGERNumber of unique macro identifiers
NUIDINTEGERNumber of unique object and object-like identifiers
NGNSOCINTEGERNumber of global namespace occupants at function's top
NPARAMINTEGERNumber of parameters
MAXNESTINTEGERMaximum level of statement nesting
NLABELINTEGERNumber of goto labels
FANININTEGERFan-in (number of calling functions)
FANOUTINTEGERFan-out (number of called functions)
CCYCL1INTEGERCyclomatic complexity (control statements)
CCYCL2INTEGERExtended cyclomatic complexity (includes branching operators)
CCYCL3INTEGERMaximum cyclomatic complexity (includes branching operators and all switch branches)
CSTRUCREALStructure complexity (Henry and Kafura)
CHALREALHalstead complexity
IFLOWREALInformation flow metric (Henry and Selig)
FIDBEGININTEGERFile key of the function's definition begin (references FILES)
FOFFSETBEGININTEGEROffset of definition begin within the file
FIDENDINTEGERFile key of the function's definition end (references FILES)
FOFFSETENDINTEGEROffset of definition end within the file

Table FUNCTIONID

Identifiers comprising a function's name.

Field name Field type Value description
FUNCTIONIDINTEGER or BIGINT1Function identifier key (references FUNCTIONS)
ORDINALINTEGERPosition of the identifier within the function name (0-based)
EIDINTEGER or BIGINT1Identifier key (references IDS)

Table FCALLS

Function calls.

Field name Field type Value description
SOURCEIDINTEGER or BIGINT1Calling function identifier key (references FUNCTIONS)
DESTIDINTEGER or BIGINT1Called function identifier key (references FUNCTIONS)

Table FILECOPIES

Files occuring in more than one copy.

Field name Field type Value description
GROUPIDINTEGERFile group identifier
FIDINTEGERKey of file belonging to a group of identical files (references FILES)

Note 1: INTEGER on 32-bit architectures, BIGINT on 64-bit archiectures.