<commit_before># Coding Guidelines
## Table of Contents

- [General](#general)
- [Comments](#comments)
- [Strings](#strings)
- [Variables and Attribute Names](#variables-and-attribute-names)
- [Object Literals](#object-literals)
- [Indentation and Line Breaks](#indentation-and-line-breaks)
- [Functions](#functions)
- [Control Statements](#control-statements)
  - [Ternaries](#ternaries)
- [JSDoc](#jsdoc)
- [JSX](#jsx)
	- [Self Contained Elements](#self-contained-elements)
	- [Non Self Contained Elements](#non-self-contained-elements)


## General
We are using the eslintrc to lint our code. All basic rules are defined there, some important rules are:
  - Max line length is 80 characters.
  - Indentation is 2 spaces.
  - No multiple empty lines.

We prefer a functional approach and try to use these abstractions over
normal control statements. Functions and code must be
self-descriptive, use JSDoc blocks only if necessary.

## Comments
Rules:
- Comments must be prefixed with a space sign.
- The `*` sign is a exception to the rule.

Examples:
```JS
// Single line Comment

//* A Exception to the space rule

/**
* Block Comment
*/
```

## Strings
 - Strings are defined with double quotes.
 - Use template strings if variables are used.

Example:
```JS
var string = `Hello ${world}!`;
```

## Variables and Attribute Names
Variable names always use camelCase names, except Constants which use UPPER_CASE.
One var, let or const per variable and line.

Examples:
```JS
var camelCase = "{value}";
let CamelCase = new Object();
const SOME_CONSTANT = "constant value";
```

## Object Literals
Object literals must have no space after the '{' or before the '}' signs.

Valid Example
```JS
var objectLiteral = {"key": "value", "key2": "value2"};

var objectLiteral = {
  "key": "value",
  "key2": "value2",
  "key3": "value3",
  "key4": "value4"
};
```


## Indentation and Line Breaks
Rules:
- Line breaks are only done if needed.
- Strings are split at the latest possible position.
  - At the latest whitespace character.
  - The second line is indented with 2 spaces.
  ```JS
    var longString = "A very long string which is longer then one line, which is 80 characters " +
      "in this case. This demonstrates how the second line is indented";
  ```
- Object literals are kept on one line if possible.
  - If the line gets to long put each attribute on a single line.
  - Multi level object literals must be split in to multiple lines.
    - Each level in the object must have 2 spaces as indentation.

Examples:
```JS
test(
  "A very long string that is longer then one line, which is 80 characters " +
    "in this case. This demonstrates how the second line is indented.",
  "Another string parameter.",
  {and: "a Literal Object", as: "a parameter", type: "short"},
  {
    yet: "another long parameter Object",
    which: "needs to be split in multiple",
    lines: 3
  }
);

test({
  a: {
    b: 10
  },
  c: 20,<commit_msg>Change line breaks in an argument list.<commit_after># Coding Guidelines
## Table of Contents

- [General](#general)
- [Comments](#comments)
- [Strings](#strings)
- [Variables and Attribute Names](#variables-and-attribute-names)
- [Object Literals](#object-literals)
- [Indentation and Line Breaks](#indentation-and-line-breaks)
- [Functions](#functions)
- [Control Statements](#control-statements)
  - [Ternaries](#ternaries)
- [JSDoc](#jsdoc)
- [JSX](#jsx)
	- [Self Contained Elements](#self-contained-elements)
	- [Non Self Contained Elements](#non-self-contained-elements)


## General
We are using the eslintrc to lint our code. All basic rules are defined there, some important rules are:
  - Max line length is 80 characters.
  - Indentation is 2 spaces.
  - No multiple empty lines.

We prefer a functional approach and try to use these abstractions over
normal control statements. Functions and code must be
self-descriptive, use JSDoc blocks only if necessary.

## Comments
Rules:
- Comments must be prefixed with a space sign.
- The `*` sign is a exception to the rule.

Examples:
```JS
// Single line Comment

//* A Exception to the space rule

/**
* Block Comment
*/
```

## Strings
 - Strings are defined with double quotes.
 - Use template strings if variables are used.

Example:
```JS
var string = `Hello ${world}!`;
```

## Variables and Attribute Names
Variable names always use camelCase names, except Constants which use UPPER_CASE.
One var, let or const per variable and line.

Examples:
```JS
var camelCase = "{value}";
let CamelCase = new Object();
const SOME_CONSTANT = "constant value";
```

## Object Literals
Object literals must have no space after the '{' or before the '}' signs.

Valid Example
```JS
var objectLiteral = {"key": "value", "key2": "value2"};

var objectLiteral = {
  "key": "value",
  "key2": "value2",
  "key3": "value3",
  "key4": "value4"
};
```


## Indentation and Line Breaks
Rules:
- Line breaks are only done if needed.
- Strings are split at the latest possible position.
  - At the latest whitespace character.
  - The second line is indented with 2 spaces.
  ```JS
    var longString = "A very long string which is longer then one line, which is 80 characters " +
      "in this case. This demonstrates how the second line is indented";
  ```
- Object literals are kept on one line if possible.
  - If the line gets to long put each attribute on a single line.
  - Multi level object literals must be split in to multiple lines.
    - Each level in the object must have 2 spaces as indentation.

Examples:
```JS
test(
  "A very long string that is longer then one line, which is 80 characters " +
    "in this case. This demonstrates how the second line is indented.",
  "Another string parameter.",
  {and: "a Literal Object", as: "a parameter", type: "short"}, {
    yet: "another long parameter Object",
    which: "needs to be split in multiple",
    lines: 3
  }
);

test({
  a: {
    b: 10
  },
  c: 20,
{'fraction_non_alphanumeric': 0.11289776574136763, 'fraction_numerical': 0.007447528774542992, 'mean_word_length': 3.757648953301127, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6121385', 'n_tokens_mistral': 1845, 'n_tokens_neox': 1722, 'n_words': 763}