diff --git a/votingapi_bayesian.functions.inc b/votingapi_bayesian.functions.inc
index 0743ab4..f40cb9b 100644
--- a/votingapi_bayesian.functions.inc
+++ b/votingapi_bayesian.functions.inc
@@ -1,8 +1,16 @@
 <?php
 
-// This file hold all the mathematical functions
-// defined by hook: 'votingapi_bayesian_functions_info'.
-
+/**
+ * @file
+ * File name: votingapi_bayesian.helpers.inc.
+ *
+ * This file hold all the mathematical functions
+ * defined by hook: 'votingapi_bayesian_functions_info'.
+ */
+
+/**
+ * Get vote count by item.
+ */
 function _votingapi_bayesian_get_vote_count_by_item($entity_type, $tag = 'vote', $entity_id = NULL) {
   $query = db_select('votingapi_vote', 'v')
     ->condition('tag', $tag, '=')
@@ -17,15 +25,24 @@ function _votingapi_bayesian_get_vote_count_by_item($entity_type, $tag = 'vote',
   return $query->execute()->fetchfield(0);
 }
 
+/**
+ * Get vote count.
+ */
 function _votingapi_bayesian_get_vote_count($entity_type, $tag = 'vote', $entity_id = NULL) {
   return _votingapi_bayesian_get_vote_count_by_item($entity_type, $tag, NULL);
 }
 
+/**
+ * Get total sum.
+ */
 function _votingapi_bayesian_get_total_sum($entity_type, $tag = 'vote') {
   $query = db_query('SELECT SUM(value) FROM votingapi_vote WHERE entity_type = :type AND tag = :tag', array(':type' => $entity_type, ':tag' => $tag));
   return $query->fetchfield(0);
 }
 
+/**
+ * Get avg by item.
+ */
 function _votingapi_bayesian_get_avg_by_item($entity_type, $tag = 'vote', $entity_id = NULL) {
   $query = db_select('votingapi_vote', 'v')
     ->condition('tag', $tag, '=')
@@ -40,14 +57,23 @@ function _votingapi_bayesian_get_avg_by_item($entity_type, $tag = 'vote', $entit
   return $query->execute()->fetchfield(0);
 }
 
+/**
+ * Get zero.
+ */
 function _votingapi_bayesian_get_zero($entity_type, $tag = 'vote', $entity_id = NULL) {
   return 0;
 }
 
+/**
+ * Get avg.
+ */
 function _votingapi_bayesian_get_avg($entity_type, $tag = 'vote', $entity_id = NULL) {
   return _votingapi_bayesian_get_avg_by_item($entity_type, $tag, NULL);
 }
 
+/**
+ * Get avg vote count.
+ */
 function _votingapi_bayesian_get_avg_vote_count($entity_type, $tag = 'vote', $empty = NULL) {
   $query = db_select('votingapi_vote', 'v')
     ->condition('tag', $tag, '=')
@@ -57,6 +83,9 @@ function _votingapi_bayesian_get_avg_vote_count($entity_type, $tag = 'vote', $em
   return $query->execute()->fetchfield(0);
 }
 
+/**
+ * Get num distinct item.
+ */
 function _votingapi_bayesian_get_num_distinct_item($entity_type, $tag = 'vote', $empty = NULL) {
   $query = db_select('votingapi_vote', 'v')
     ->condition('tag', $tag, '=')
@@ -66,10 +95,16 @@ function _votingapi_bayesian_get_num_distinct_item($entity_type, $tag = 'vote',
   return $query->execute()->fetchfield(0);
 }
 
+/**
+ * Get min.
+ */
 function _votingapi_bayesian_get_min($entity_type, $tag = 'vote', $entity_id = NULL) {
   return _votingapi_bayesian_get_min_by_item($entity_type, $tag, NULL);
 }
 
+/**
+ * Get min by item.
+ */
 function _votingapi_bayesian_get_min_by_item($entity_type, $tag = 'vote', $entity_id = NULL) {
   $query = db_select('votingapi_vote', 'v')
     ->condition('tag', $tag, '=')
@@ -84,10 +119,16 @@ function _votingapi_bayesian_get_min_by_item($entity_type, $tag = 'vote', $entit
   return $query->execute()->fetchfield(0);
 }
 
+/**
+ * Get max.
+ */
 function _votingapi_bayesian_get_max($entity_type, $tag = 'vote', $entity_id = NULL) {
   return _votingapi_bayesian_get_max_by_item($entity_type, $tag, NULL);
 }
 
+/**
+ * Get max by item.
+ */
 function _votingapi_bayesian_get_max_by_item($entity_type, $tag = 'vote', $entity_id = NULL) {
   $query = db_select('votingapi_vote', 'v')
     ->condition('tag', $tag, '=')
@@ -102,16 +143,35 @@ function _votingapi_bayesian_get_max_by_item($entity_type, $tag = 'vote', $entit
   return $query->execute()->fetchfield(0);
 }
 
+/**
+ * Get item median.
+ *
+ * @codingStandardsIgnoreStart
+ */
 function _votingapi_bayesian_get_item_median($entity_type, $tag = 'vote', $entity_id) {
-  $query = db_query('SELECT x.value from votingapi_vote x, votingapi_vote y WHERE x.entity_type = :type AND x.tag = :tag AND x.entity_id = :id GROUP BY x.value HAVING SUM(SIGN(1-SIGN(y.value-x.value)))/COUNT(*) > .5 LIMIT 1;', array(':type' => $entity_type, ':tag' => $tag, 'id' => $entity_id));
+  // @codingStandardsIgnoreEnd
+  $query = db_query('SELECT x.value from votingapi_vote x, votingapi_vote y WHERE x.entity_type = :type AND x.tag = :tag AND x.entity_id = :id GROUP BY x.value HAVING SUM(SIGN(1-SIGN(y.value-x.value)))/COUNT(*) > .5 LIMIT 1;', array(
+    ':type' => $entity_type,
+    ':tag' => $tag,
+    'id' => $entity_id,
+  ));
   return $query->fetchfield(0);
 }
 
+/**
+ * Get items median.
+ *
+ * @codingStandardsIgnoreStart
+ */
 function _votingapi_bayesian_get_items_median($entity_type, $tag = 'vote', $empty) {
+  // @codingStandardsIgnoreEnd
   $query = db_query('SELECT x.value from votingapi_vote x, votingapi_vote y WHERE x.entity_type = :type AND x.tag = :tag GROUP BY x.value HAVING SUM(SIGN(1-SIGN(y.value-x.value)))/COUNT(*) > .5 LIMIT 1;', array(':type' => $entity_type, ':tag' => $tag));
   return $query->fetchfield(0);
 }
 
+/**
+ * Get std by item.
+ */
 function _votingapi_bayesian_get_std_by_item($entity_type, $tag = 'vote', $entity_id = NULL) {
   $query = db_select('votingapi_vote', 'v')
     ->condition('tag', $tag, '=')
@@ -126,10 +186,16 @@ function _votingapi_bayesian_get_std_by_item($entity_type, $tag = 'vote', $entit
   return $query->execute()->fetchfield(0);
 }
 
+/**
+ * Get std.
+ */
 function _votingapi_bayesian_get_std($entity_type, $tag = 'vote', $entity_id = NULL) {
   return _votingapi_bayesian_get_std_by_item($entity_type, $tag, NULL);
 }
 
+/**
+ * Get variance by item.
+ */
 function _votingapi_bayesian_get_variance_by_item($entity_type, $tag = 'vote', $entity_id = NULL) {
   $query = db_select('votingapi_vote', 'v')
     ->condition('tag', $tag, '=')
@@ -144,6 +210,9 @@ function _votingapi_bayesian_get_variance_by_item($entity_type, $tag = 'vote', $
   return $query->execute()->fetchfield(0);
 }
 
+/**
+ * Get variance.
+ */
 function _votingapi_bayesian_get_variance($entity_type, $tag = 'vote', $entity_id = NULL) {
   return _votingapi_bayesian_get_variance_by_item($entity_type, $tag, NULL);
 }
diff --git a/votingapi_bayesian.helpers.inc b/votingapi_bayesian.helpers.inc
index 596cee7..9450c42 100644
--- a/votingapi_bayesian.helpers.inc
+++ b/votingapi_bayesian.helpers.inc
@@ -1,9 +1,15 @@
 <?php
 
 /**
+ * @file
+ * File name: votingapi_bayesian.helpers.inc.
+ */
+
+/**
  * Returns and validate the configuration from the database.
  *
  * @return array
+ *   Array with configuration.
  */
 function _votingapi_bayesian_configuration() {
   $configuration = variable_get('votingapi_bayesian_config', array());
@@ -12,7 +18,7 @@ function _votingapi_bayesian_configuration() {
     $configuration['config'] = array();
   }
 
-  foreach($configuration['config'] as $tag => $data) {
+  foreach ($configuration['config'] as $tag => $data) {
     if (!isset($data['function_c']) || !isset($data['function_m'])) {
       unset($configuration['config'][$tag]);
       continue;
@@ -30,16 +36,19 @@ function _votingapi_bayesian_configuration() {
 /**
  * Custom callback to sort functions by their name attribute.
  *
- * @param $a
- * @param $b
+ * @param array $a
+ *   Array with first string.
+ * @param array $b
+ *   Array with second string.
+ *
  * @return int
+ *   Result of strcmp().
  */
 function _votingapi_bayesian_sort_array_key_name($a, $b) {
   return strcmp($a['name'], $b['name']);
 }
 
 /**
- *
  * Compute the Bayesian average for an item.
  *
  * This function will dynamically call the functions to compute the parameter
@@ -47,45 +56,51 @@ function _votingapi_bayesian_sort_array_key_name($a, $b) {
  * The parameters sent to those functions are:
  *  - The entity_type
  *  - The tag
- *  - The entity_id
+ *  - The entity_id.
+ *
+ * @param string $entity_type
+ *   String with entity type.
+ * @param mixed $entity_id
+ *   ID of Entity.
+ * @param array $config
+ *   Array with Config values.
  *
- * @param $entity_type
- * @param $entity_id
- * @param $config
  * @return float|int
+ *   Return value in float or int format.
  */
 function _votingapi_bayesian_compute($entity_type, $entity_id, $config) {
-  /**
-   * Bayesian formula
-   *
-   * (C * m) + (ITEM_NUM_VOTE * ITEM_AVG_RATING)
-   * ---------------------------------------------
-   *         (C + ITEM_NUM_VOTE)
-   *
-   * See: http://goo.gl/EQ0D9M
-   *
-   */
+
+  // Bayesian formula
+  // (C * m) + (ITEM_NUM_VOTE * ITEM_AVG_RATING)
+  // ---------------------------------------------
+  // (C + ITEM_NUM_VOTE)
+  // See: http://goo.gl/EQ0D9M.
   $item_num_vote   = _votingapi_bayesian_get_vote_count_by_item($entity_type, $config['tag'], $entity_id);
   $item_avg_rating = _votingapi_bayesian_get_avg_by_item($entity_type, $config['tag'], $entity_id);
 
   /*
    * C is assigned a value that is proportional to the typical data set size.
-   * The value is larger when the expected variation between data sets (within the larger population) is small.
-   * It is smaller, when the data sets are expected to vary substantially from one another.
+   * The value is larger when the expected variation between data sets
+   * (within the larger population) is small.
+   * It is smaller, when the data sets are expected
+   * to vary substantially from one another.
    */
   $c = $config['function_c']($entity_type, $config['tag'], $entity_id);
 
   /*
-   * In cases where the averages' relative values are the only result of importance, m can be replaced with zero.
+   * In cases where the averages' relative values are the only result
+   * of importance, m can be replaced with zero.
    */
   $m = $config['function_m']($entity_type, $config['tag'], $entity_id);
 
   $result = 0;
 
-  if ( 0 != ($c + $item_num_vote)) {
-    $result = (($c*$m + ($item_num_vote * $item_avg_rating)) / ($c + $item_num_vote));
-    //$msg = " ( ( " . $c . " * " . $m . " ) + ( " . $item_num_vote . " * " . $item_avg_rating . " ) ) / ( " . $c . " + " . $item_num_vote . " ) ) = " . $result;
-    //echo $msg . "\n";
+  if (0 != ($c + $item_num_vote)) {
+    $result = (($c * $m + ($item_num_vote * $item_avg_rating)) / ($c + $item_num_vote));
+    // $msg = " ( ( " . $c . " * " . $m . " ) +
+    // ( " . $item_num_vote . " * " . $item_avg_rating . " ) ) /
+    // ( " . $c . " + " . $item_num_vote . " ) ) = " . $result;
+    // echo $msg . "\n";.
   }
 
   return $result;
@@ -94,8 +109,10 @@ function _votingapi_bayesian_compute($entity_type, $entity_id, $config) {
 /**
  * Compute the Bayesian average for all the items.
  *
- * @param $entity_type
- * @param $config
+ * @param string $entity_type
+ *   String with entity type.
+ * @param array $config
+ *   Array with Config values.
  */
 function _votingapi_bayesian_regenerate($entity_type, $config) {
   $query = db_select('votingapi_cache', 'v')->distinct()
@@ -104,10 +121,10 @@ function _votingapi_bayesian_regenerate($entity_type, $config) {
     ->condition('entity_type', $entity_type, '=');
   $result = $query->execute();
 
-  while($record = $result->fetchObject()) {
+  while ($record = $result->fetchObject()) {
     db_update('votingapi_cache')
       ->fields(array(
-        'value' => _votingapi_bayesian_compute($entity_type, $record->entity_id, $config)
+        'value' => _votingapi_bayesian_compute($entity_type, $record->entity_id, $config),
       ))
       ->condition('function', 'bayesian', '=')
       ->condition('entity_type', $entity_type, '=')
diff --git a/votingapi_bayesian.install b/votingapi_bayesian.install
index fcb5e14..916dc21 100644
--- a/votingapi_bayesian.install
+++ b/votingapi_bayesian.install
@@ -1,7 +1,12 @@
 <?php
 
 /**
- * Implementation of hook_uninstall().
+ * @file
+ * Install, Uninstall and Update functions for Voting API Bayesian module.
+ */
+
+/**
+ * Implements hook_uninstall().
  */
 function votingapi_bayesian_uninstall() {
   variable_del('votingapi_bayesian_config');
diff --git a/votingapi_bayesian.module b/votingapi_bayesian.module
index 59c4bf7..71e104f 100644
--- a/votingapi_bayesian.module
+++ b/votingapi_bayesian.module
@@ -1,12 +1,14 @@
 <?php
 
-/*
- * Include helpers functions.
+/**
+ * @file
+ * Module file for Voting API Bayesian module.
  */
+
+// Include helpers functions.
 include 'votingapi_bayesian.helpers.inc';
-/*
- * Include mathematical functions.
- */
+
+// Include mathematical functions.
 include 'votingapi_bayesian.functions.inc';
 
 /**
@@ -31,7 +33,7 @@ function votingapi_bayesian_votingapi_results_alter(&$vote_results, $entity_type
 
     }
 
-    foreach((array) $configuration['config'] as $tag => $config) {
+    foreach ((array) $configuration['config'] as $tag => $config) {
       $config['tags'] = array_keys($configuration['config']);
 
       if (in_array($tag, $config['tags'])) {
@@ -48,19 +50,21 @@ function votingapi_bayesian_votingapi_metadata_alter(&$data) {
   $data['functions']['bayesian'] = array(
     'name' => t('Bayesian Average'),
     'description' => t('The Bayesian average from the votes.'),
-    'module' => 'bayesian'
+    'module' => 'bayesian',
   );
 }
 
 /**
- *
  * API function to get the defined functions from all the module.
  *
  * This function provides the hook: 'votingapi_bayesian_functions_info'.
  * This function provides the alter hook: 'votingapi_bayesian_functions_info'.
  *
- * @param null $function
+ * @param mixed $function
+ *   Function.
+ *
  * @return array|bool
+ *   Array with functions info or FALSE.
  */
 function votingapi_bayesian_get_functions_info($function = NULL) {
   static $drupal_static_fast;
@@ -81,9 +85,11 @@ function votingapi_bayesian_get_functions_info($function = NULL) {
     }
   }
 
-  foreach($functions_info as $function_name => $data) {
+  foreach ($functions_info as $function_name => $data) {
     if (!function_exists($function_name)) {
+      // @codingStandardsIgnoreStart
       watchdog('votingapi_bayesian', t('@function is undefined.', array('@function' => $function_name)), array(), WATCHDOG_ERROR);
+      // @codingStandardsIgnoreEnd
       unset($functions_info[$function_name]);
     }
   }
@@ -109,80 +115,80 @@ function votingapi_bayesian_votingapi_bayesian_functions_info() {
     ),
     '_votingapi_bayesian_get_avg_vote_count' => array(
       'name' => 'Average vote count',
-      'description' => 'The average number of vote per item.'
+      'description' => 'The average number of vote per item.',
     ),
     '_votingapi_bayesian_get_num_distinct_item' => array(
       'name' => 'Number of distinct items',
-      'description' => 'Distinct number of items.'
+      'description' => 'Distinct number of items.',
     ),
     '_votingapi_bayesian_get_vote_count' => array(
       'name' => 'Number of vote',
-      'description' => 'Total number of votes.'
+      'description' => 'Total number of votes.',
     ),
     '_votingapi_bayesian_get_vote_count_by_item' => array(
       'name' => 'Number of vote by item',
-      'description' => 'Total number of votes on the item.'
+      'description' => 'Total number of votes on the item.',
     ),
     '_votingapi_bayesian_get_avg' => array(
       'name' => 'Average',
       'description' => 'The arithmetic average (or mean) of the values on items where value is greater than zero.',
-      'website' => 'https://en.wikipedia.org/wiki/Average'
+      'website' => 'https://en.wikipedia.org/wiki/Average',
     ),
     '_votingapi_bayesian_get_avg_by_item' => array(
       'name' => 'Average by item',
       'description' => 'The arithmetic average (or mean) of the values of an item where value is greater than zero.',
-      'website' => 'https://en.wikipedia.org/wiki/Average'
+      'website' => 'https://en.wikipedia.org/wiki/Average',
     ),
     '_votingapi_bayesian_get_min' => array(
       'name' => 'Minimum',
-      'description' => 'Minimum value of the votes in all items.'
+      'description' => 'Minimum value of the votes in all items.',
     ),
     '_votingapi_bayesian_get_min_by_item' => array(
       'name' => 'Minimum by item',
-      'description' => 'Minimum value of the votes on an item.'
+      'description' => 'Minimum value of the votes on an item.',
     ),
     '_votingapi_bayesian_get_max' => array(
       'name' => 'Maximum',
-      'description' => 'Maximum value of the votes in all items.'
+      'description' => 'Maximum value of the votes in all items.',
     ),
     '_votingapi_bayesian_get_max_by_item' => array(
       'name' => 'Maximum by item',
-      'description' => 'Maximum value of the votes on an item.'
+      'description' => 'Maximum value of the votes on an item.',
     ),
     '_votingapi_bayesian_get_std' => array(
       'name' => 'Standard deviation',
       'description' => 'The standard deviation is found by taking the square root of the average of the squared differences of the values from their average value.',
-      'website' => 'https://en.wikipedia.org/wiki/Standard_deviation'
+      'website' => 'https://en.wikipedia.org/wiki/Standard_deviation',
     ),
     '_votingapi_bayesian_get_std_by_item' => array(
       'name' => 'Standard deviation by item',
       'description' => 'The standard deviation by item is found by taking the square root of the average of the squared differences of the values from their average value.',
-      'website' => 'https://en.wikipedia.org/wiki/Standard_deviation'
+      'website' => 'https://en.wikipedia.org/wiki/Standard_deviation',
     ),
     '_votingapi_bayesian_get_variance' => array(
       'name' => 'Variance',
       'description' => 'In probability theory and statistics, variance measures how far a set of numbers is spread out. A variance of zero means that all the values are identical.',
-      'website' => 'https://en.wikipedia.org/wiki/Variance'
+      'website' => 'https://en.wikipedia.org/wiki/Variance',
     ),
     '_votingapi_bayesian_get_variance_by_item' => array(
       'name' => 'Variance by item',
       'description' => 'The variance measures how far a set of numbers is spread out. A variance of zero means that all the values are identical.',
-      'website' => 'https://en.wikipedia.org/wiki/Variance'
+      'website' => 'https://en.wikipedia.org/wiki/Variance',
     ),
     '_votingapi_bayesian_get_items_median' => array(
       'name' => 'Median',
       'description' => 'The median is the numerical value separating the higher half of a data sample from the lower half.',
-      'website' => 'https://en.wikipedia.org/wiki/Median'
+      'website' => 'https://en.wikipedia.org/wiki/Median',
     ),
     '_votingapi_bayesian_get_item_median' => array(
       'name' => 'Median by item',
       'description' => 'The median is the numerical value separating the higher half of a data sample from the lower half.',
-      'website' => 'https://en.wikipedia.org/wiki/Median'
+      'website' => 'https://en.wikipedia.org/wiki/Median',
     ),
     '_votingapi_bayesian_get_zero' => array(
       'name' => 'Zero',
-      'description' => 'Return zero.'
-    )
+      'description' => 'Return zero.',
+    ),
   );
 }
 
@@ -205,7 +211,7 @@ function votingapi_bayesian_setting_form($form, $form_state) {
     '#type' => 'fieldset',
     '#title' => 'Bayesian computation configuration',
     '#collapsible' => TRUE,
-    '#tree' => TRUE
+    '#tree' => TRUE,
   );
 
   $votingapi_metadata = votingapi_metadata();
@@ -217,7 +223,7 @@ function votingapi_bayesian_setting_form($form, $form_state) {
   $result = $query->execute()->fetchAllAssoc('tag');
 
   $tags = array();
-  foreach($votingapi_metadata['tags'] as $tag => $tag_data) {
+  foreach ($votingapi_metadata['tags'] as $tag => $tag_data) {
     $stats = isset($result[$tag]) ? (array) $result[$tag] : array('votes' => 0);
     $tags[$tag] = $tag . '(' . $stats['votes'] . ' votes)';
   }
@@ -231,17 +237,17 @@ function votingapi_bayesian_setting_form($form, $form_state) {
     '#title' => 'Available tags',
     '#description' => t('Select the VotingAPI tag(s) on which to apply the computation.'),
     '#options' => $tags,
-    '#default_value' => $default_value
+    '#default_value' => $default_value,
   );
 
   $functions_info = votingapi_bayesian_get_functions_info();
 
   $functions = array();
-  foreach($functions_info as $function => $data) {
+  foreach ($functions_info as $function => $data) {
     $functions[$function] = $data['name'];
   }
 
-  foreach((array) $tags as $tag => $data) {
+  foreach ((array) $tags as $tag => $data) {
     $votingapi_bayesian_tags_config[$tag] = array(
       '#weight' => 1,
       '#type' => 'fieldset',
@@ -249,15 +255,15 @@ function votingapi_bayesian_setting_form($form, $form_state) {
       '#collapsible' => TRUE,
       '#states' => array(
         'visible' => array(
-          ':input[name="votingapi_bayesian_config[votingapi_bayesian_tags][' . $tag . ']"]' => array('checked' => TRUE)
-        )
-      )
+          ':input[name="votingapi_bayesian_config[votingapi_bayesian_tags][' . $tag . ']"]' => array('checked' => TRUE),
+        ),
+      ),
     );
 
     if (empty($votingapi_bayesian_config['config'][$tag])) {
       $votingapi_bayesian_config['config'][$tag] = array(
         'function_c' => '_votingapi_bayesian_get_avg_vote_count',
-        'function_m' => '_votingapi_bayesian_get_std'
+        'function_m' => '_votingapi_bayesian_get_std',
       );
     }
 
@@ -265,14 +271,14 @@ function votingapi_bayesian_setting_form($form, $form_state) {
       '#type' => 'select',
       '#title' => 'Function to compute C',
       '#options' => $functions,
-      '#default_value' => isset($votingapi_bayesian_config['config'][$tag]['function_c']) ? $votingapi_bayesian_config['config'][$tag]['function_c'] : ''
+      '#default_value' => isset($votingapi_bayesian_config['config'][$tag]['function_c']) ? $votingapi_bayesian_config['config'][$tag]['function_c'] : '',
     );
 
     $votingapi_bayesian_tags_config[$tag]['function_m'] = array(
       '#type' => 'select',
       '#title' => 'Function to compute m',
       '#options' => $functions,
-      '#default_value' => isset($votingapi_bayesian_config['config'][$tag]['function_m']) ? $votingapi_bayesian_config['config'][$tag]['function_m'] : ''
+      '#default_value' => isset($votingapi_bayesian_config['config'][$tag]['function_m']) ? $votingapi_bayesian_config['config'][$tag]['function_m'] : '',
     );
 
     $form['votingapi_bayesian_config']['config'] = $votingapi_bayesian_tags_config;
@@ -282,25 +288,27 @@ function votingapi_bayesian_setting_form($form, $form_state) {
     '#type' => 'fieldset',
     '#title' => 'Functions documentation',
     '#collapsible' => TRUE,
-    '#collapsed' => TRUE
+    '#collapsed' => TRUE,
   );
 
-  foreach($functions_info as $function => $data) {
+  foreach ($functions_info as $function => $data) {
     $doc_fieldset = array(
       '#type' => 'fieldset',
       '#title' => $data['name'],
       '#collapsible' => TRUE,
       '#collapsed' => TRUE,
-      '#tree' => TRUE
+      '#tree' => TRUE,
     );
 
     $doc_fieldset['description'] = array(
-      '#markup' => '<p>' . $data['description'] . '</p>'
+      '#markup' => '<p>' . $data['description'] . '</p>',
     );
 
     if (isset($data['website']) && valid_url($data['website'], TRUE)) {
       $doc_fieldset['website'] = array(
-        '#markup' => '<p>' . l('More information', $data['website'], array('attributes' => array('target' => '_blank'))) . '</p>'
+        // @codingStandardsIgnoreStart
+        '#markup' => '<p>' . l('More information', $data['website'], array('attributes' => array('target' => '_blank'))) . '</p>',
+        // @codingStandardsIgnoreEnd
       );
     }
 
@@ -316,7 +324,7 @@ function votingapi_bayesian_setting_form($form, $form_state) {
 function votingapi_bayesian_setting_form_validate($form, &$form_state) {
   $votingapi_bayesian_config = array();
 
-  foreach($form_state['values']['votingapi_bayesian_config']['votingapi_bayesian_tags'] as $tag) {
+  foreach ($form_state['values']['votingapi_bayesian_config']['votingapi_bayesian_tags'] as $tag) {
     if (isset($form_state['values']['votingapi_bayesian_config']['config'][$tag])) {
       $votingapi_bayesian_config[$tag] = $form_state['values']['votingapi_bayesian_config']['config'][$tag];
     }
diff --git a/votingapi_bayesian_example/votingapi_bayesian_example.module b/votingapi_bayesian_example/votingapi_bayesian_example.module
index 1865717..03c8e3c 100644
--- a/votingapi_bayesian_example/votingapi_bayesian_example.module
+++ b/votingapi_bayesian_example/votingapi_bayesian_example.module
@@ -1,26 +1,37 @@
 <?php
 
 /**
+ * @file
+ * Name: votingapi_bayesian_example.module.
+ */
+
+/**
  * Implements hook_votingapi_bayesian_functions_info().
- *
- * @return array
  */
 function votingapi_bayesian_example_votingapi_bayesian_functions_info() {
   return array(
     '_votingapi_bayesian_example_get_random' => array(
       'name' => 'Random',
-      'description' => 'Returns a random number between 0 and 1.'
-    )
+      'description' => 'Returns a random number between 0 and 1.',
+    ),
   );
 }
 
 /**
- * Custom Mathematical functions defined in hook: 'votingapi_bayesian_functions_info'
+ * Example get random.
+ *
+ * Custom Mathematical functions defined in hook:
+ * 'votingapi_bayesian_functions_info'.
+ *
+ * @param mixed $arg1
+ *   First argument.
+ * @param mixed $arg2
+ *   Second argument.
+ * @param mixed $arg3
+ *   Third argument.
  *
- * @param $arg1
- * @param $arg2
- * @param $arg3
  * @return float
+ *   Result of: mt_rand() / mt_getrandmax().
  */
 function _votingapi_bayesian_example_get_random($arg1, $arg2, $arg3) {
   return mt_rand() / mt_getrandmax();
