Useful Links:

Introducing...

NagVis is a visualization addon for the well known network managment system Nagios.

NagVis can be used to visualize Nagios Data, e.g. to display IT processes like a mail system or a network infrastructure.

NagVis Developer Guidelines

These guidelines have been written to assist new developers by coding for or with NagVis. The guidelines have to be considered in NagVis 1.x by all developers to keep a clean codebase.

Code Formating

Comments

User two slashes followed by a whitespace for single line comments:
// my comment
For multi line comments use the following format:
/**
 * My multi
 * line comment
 */

Brackets

Brackets are always used like this:
if(...) {
    ...
} elseif() {
    ...
} else {
    ...
}

When there is only one command (not a whole block) after an if/else statement it is allowed to skip the brackets. But in many cases it is recommended to use the brackets because this makes the code easier to read for others.

Intending the code: Spaces/Tabs

Since NagVis 1.6x code NagVis uses 4 spaces for intending code (at line beginnings). Even if it is common to use the tabstop char as representative for 8 spaces we do not allow tabs as intend char. So please care about removing eventually tabstop chars from your code.

Class naming

The first char has to be upper case. Each new word is upper case too.

We seperate classes in types using the leading grouping keywords like Core, Global, NagVis. Global classes are used by several components. The other classes are used in the seperate packets. Global-Classes are manly extended by local classes in NagVis or Wui. Example for class definition:

class GlobalCore {
    ...
}

Objects

Objects are always upper case and named like the Class they are objects from. Example for object initialisation:
$MAP = new NagVisMap(...);

Methods

Methods start with lower case, the first word should be a verb like get, set, make, create, update, ... the next words begin with an upper case letter and descript what the method does. Example for a method definition:
function setRuntimeValue(...) {
    ...
}
Each method should have a multi line comment before it starts, like this example:
   /**
    *
    * Gets an input row
    *
    * @param 	String 	$myString  Description
    * @return	Boolean
    * @author 	Lars Michelsen <lars@vertical-visions.de>
    */
    function myMethod(...) {
        ...
    }
You do not need to write all the above details down for each method. If it is not neccessary to write the
@return
or
@param
options bacause the code is that clear just skip these notes.

Variables

Variables start with a lower case word, all following words begin with an upper case letter. Example for a variable:
$correctExampleVar = TRUE;