diff --git a/README.md b/README.md
index 524b688..306ac31 100755
--- a/README.md
+++ b/README.md
@@ -1,7 +1,12 @@
 CAPTCHA module for Drupal
 ---------------------------
-[![Build Status](https://travis-ci.org/chuva-inc/captcha.svg?branch=8.x-1.x)](https://travis-ci.org/chuva-inc/captcha)
-[![Code Climate](https://codeclimate.com/github/chuva-inc/captcha/badges/gpa.svg)](https://codeclimate.com/github/chuva-inc/captcha)
+[![Build Status]
+(https://travis-ci.org/chuva-inc/captcha.svg?branch=8.x-1.x)]
+(https://travis-ci.org/chuva-inc/captcha)
+
+[![Code Climate]
+(https://codeclimate.com/github/chuva-inc/captcha/badges/gpa.svg)]
+(https://codeclimate.com/github/chuva-inc/captcha)
 
 DESCRIPTION
 -----------
@@ -14,7 +19,8 @@ SUB MODULE
 
 INSTALLATION:
 -------------
-  1. Extract the tar.gz into your 'modules' or directory and copy to modules folder.
+  1. Extract the tar.gz into your 'modules' or directory and copy to modules
+     folder.
   2. Go to "Extend" after successfully login into admin.
   3. Enable the module at 'administer >> modules'.
 
diff --git a/captcha.install b/captcha.install
index b8df48a..a3d9970 100755
--- a/captcha.install
+++ b/captcha.install
@@ -132,7 +132,7 @@ function captcha_install() {
   }
 
   // Explain to users that page caching may be disabled.
-  if ($config = \Drupal::config('system.performance')
+  if (\Drupal::config('system.performance')
     ->get('cache.page.use_internal') != 0
   ) {
     drupal_set_message(\Drupal::translation()
diff --git a/captcha.module b/captcha.module
index fbcdaf8..29439dd 100755
--- a/captcha.module
+++ b/captcha.module
@@ -198,7 +198,8 @@ function captcha_form_alter(array &$form, FormStateInterface $form_state, $form_
       $captcha_element['challenge'] = [
         '#type' => 'item',
         '#title' => t('Enabled challenge'),
-        '#markup' => t($markup, [
+        '#markup' => t('markup', [
+          '@markup' => $markup,
           '%type' => $captcha_point->getCaptchaType(),
           '@change' => $captcha_point->url('edit-form', [
             'query' => Drupal::destination()
@@ -447,7 +448,7 @@ function captcha_validate($element, FormStateInterface &$form_state) {
       // Update wrong response counter.
       if (\Drupal::config('captcha.settings')->get('enable_stats', FALSE)) {
         Drupal::state()->set('captcha.wrong_response_counter', Drupal::state()
-            ->get('captcha.wrong_response_counter', 0) + 1);
+          ->get('captcha.wrong_response_counter', 0) + 1);
       }
 
       if (\Drupal::config('captcha.settings')
diff --git a/docs/api.md b/docs/api.md
index 195160f..64dcf4b 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -1,4 +1,3 @@
-
 This documentation is for developers that want to implement their own
 challenge type and integrate it with the base CAPTCHA module.
 
@@ -79,7 +78,8 @@ core = 6.x
 
 More advanced CAPTCHA modules probably want some configuration page.
 To integrate nicely with the base CAPTCHA module you should offer your
-configuration page as a MENU_LOCAL_TASK menu entry under 'admin/config/people/captcha/'.
+configuration page as a MENU_LOCAL_TASK menu entry under
+'admin/config/people/captcha/'.
 
 For our simple foo CAPTCHA module this would mean:
 
@@ -120,7 +120,8 @@ For our simple foo CAPTCHA module this would mean:
 function foo_captcha_help($route_name, RouteMatchInterface $route_match) {
   switch ($route_name) {
     case 'foo_captcha.settings':
-      return '<p>'. t('This is a very simple challenge, which requires users to enter "foo" in a textfield.') .'</p>';
+      return '<p>'. t('This is a very simple challenge, which requires users to
+      enter "foo" in a textfield.') .'</p>';
   }
 }
 """
@@ -155,7 +156,8 @@ function foo_captcha_captcha($op, $captcha_type='') {
 /**
  * Custom CAPTCHA validation function.
  *
- * @param solution the solution for the challenge as reported by hook_captcha('generate', ...).
+ * @param solution the solution for the challenge as reported by
+    hook_captcha('generate', ...).
  * @param response the answer given by the user.
  * @return TRUE on succes and FALSE on failure.
  */
@@ -164,35 +166,37 @@ function foo_captcha_custom_validation($solution, $response) {
 }
 """
 
-Previous example shows the basic usage for custom validation with only a $solution
-and $response argument, which should be sufficient for most CAPTCHA modules.
-More advanced CAPTCHA modules can also use extra provided arguments $element
-and $form_state:
+Previous example shows the basic usage for custom validation with only a
+$solution and $response argument, which should be sufficient for most CAPTCHA
+modules. More advanced CAPTCHA modules can also use extra provided arguments
+$element and $form_state:
 """
-function foo_captcha_custom_validation($solution, $response, $element, $form_state) {
+function foo_captcha_custom_validation($solution, $response, $element,
+  $form_state) {
   return $form_state['foo']['#bar'] = 'baz';
 }
 """
-These extra arguments are the $element and $form_state arguments of the validation function
-of the #captcha element. See captcha_validate() in captcha.module for more info about this.
+These extra arguments are the $element and $form_state arguments of the
+validation function of the #captcha element. See captcha_validate() in
+captcha.module for more info about this.
 
 
 
 === Hook into CAPTCHA placement ===
 The CAPTCHA module attempts to place the CAPTCHA element in an appropriate spot
-at the bottom of the targeted form, but this automatic detection may be insufficient
-for complex forms.
-The hook_captcha_placement_map hook allows to define the placement of the CAPTCHA element
-as desired. The hook should return an array, mapping form IDs to placement arrays, which are
-associative arrays with the following fields:
-  - 'path': path (array of path items) of the form's container element in which the
-    CAPTCHA element should be inserted.
+at the bottom of the targeted form, but this automatic detection may be
+insufficient for complex forms.
+The hook_captcha_placement_map hook allows to define the placement of the
+CAPTCHA element as desired. The hook should return an array, mapping form IDs
+to placement arrays, which are associative arrays with the following fields:
+  - 'path': path (array of path items) of the form's container element in which
+    the CAPTCHA element should be inserted.
   - 'key': the key of the element before which the CAPTCHA element
-    should be inserted. If the field 'key' is undefined or NULL, the CAPTCHA will
-    just be appended in the container.
-  - 'weight': if 'key' is not NULL: should be the weight of the element defined by 'key'.
-    If 'key' is NULL and weight is not NULL/unset: set the weight property of the CAPTCHA element
-    to this value.
+    should be inserted. If the field 'key' is undefined or NULL, the CAPTCHA
+    will just be appended in the container.
+  - 'weight': if 'key' is not NULL: should be the weight of the element defined
+    by 'key'. If 'key' is NULL and weight is not NULL/unset: set the weight
+    property of the CAPTCHA element to this value.
 
 For example:
 """
diff --git a/image_captcha/image_captcha.module b/image_captcha/image_captcha.module
index 703115d..f6b559e 100755
--- a/image_captcha/image_captcha.module
+++ b/image_captcha/image_captcha.module
@@ -256,6 +256,7 @@ function image_captcha_captcha($op, $captcha_type = '', $captcha_sid = NULL) {
           case CAPTCHA_DEFAULT_VALIDATION_CASE_SENSITIVE:
             $result['captcha_validate'] = 'captcha_validate_ignore_spaces';
             break;
+
           case CAPTCHA_DEFAULT_VALIDATION_CASE_INSENSITIVE:
             $result['captcha_validate'] = 'captcha_validate_case_insensitive_ignore_spaces';
             break;
diff --git a/image_captcha/src/Form/ImageCaptchaSettingsForm.php b/image_captcha/src/Form/ImageCaptchaSettingsForm.php
index 8f11081..fcee109 100755
--- a/image_captcha/src/Form/ImageCaptchaSettingsForm.php
+++ b/image_captcha/src/Form/ImageCaptchaSettingsForm.php
@@ -299,7 +299,7 @@ class ImageCaptchaSettingsForm extends ConfigFormBase {
    * general form function image_captcha_settings_form with some
    * specific logic.
    *
-   * @return array $form
+   * @return array
    *   The font settings specific form elements.
    */
   protected function settingsDotSection() {
diff --git a/image_captcha/src/Response/CaptchaImageResponse.php b/image_captcha/src/Response/CaptchaImageResponse.php
index 13c9e18..c62bbf3 100755
--- a/image_captcha/src/Response/CaptchaImageResponse.php
+++ b/image_captcha/src/Response/CaptchaImageResponse.php
@@ -155,7 +155,6 @@ class CaptchaImageResponse extends Response {
 
     // Do we need to draw in RTL mode?
     global $language;
-    $rtl = $language->direction && ((bool) $this->config->get('image_captcha_rtl_support'));
 
     $result = $this->printString($image, $width, $height, $fonts, $font_size, $code);
     if (!$result) {
@@ -339,7 +338,6 @@ class CaptchaImageResponse extends Response {
 
     $foreground_rgb = $this->hexToRgb($this->config->get('image_captcha_foreground_color'));
     $background_rgb = $this->hexToRgb($this->config->get('image_captcha_background_color'));
-    $background_color = imagecolorallocate($image, $background_rgb[0], $background_rgb[1], $background_rgb[2]);
     $foreground_color = imagecolorallocate($image, $foreground_rgb[0], $foreground_rgb[1], $foreground_rgb[2]);
     // Precalculate the value ranges for color randomness.
     $foreground_randomness = $this->config->get('image_captcha_foreground_color_randomness');
diff --git a/src/Form/CaptchaExamplesForm.php b/src/Form/CaptchaExamplesForm.php
index 9d9dc0c..77a6ca2 100755
--- a/src/Form/CaptchaExamplesForm.php
+++ b/src/Form/CaptchaExamplesForm.php
@@ -6,6 +6,7 @@ use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Link;
 use Drupal\Core\Url;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
 
 /**
  * Displays the captcha settings form.
@@ -35,7 +36,7 @@ class CaptchaExamplesForm extends FormBase {
     else {
       // Generate a list with examples of the available CAPTCHA types.
       $form['info'] = [
-        '#markup' => t('This page gives an overview of all available challenge types, generated with their current settings.'),
+        '#markup' => $this->t('This page gives an overview of all available challenge types, generated with their current settings.'),
       ];
       foreach (\Drupal::moduleHandler()
         ->getImplementations('captcha') as $mkey => $module) {
@@ -45,13 +46,13 @@ class CaptchaExamplesForm extends FormBase {
           foreach ($challenges as $ckey => $challenge) {
             $form["captcha_{$mkey}_{$ckey}"] = [
               '#type' => 'details',
-              '#title' => t('Challenge %challenge by module %module', [
+              '#title' => $this->t('Challenge %challenge by module %module', [
                 '%challenge' => $challenge,
                 '%module' => $module,
               ]),
               'challenge' => _captcha_generate_example_challenge($module, $challenge),
               'more_examples' => [
-                '#markup' => Link::fromTextAndUrl(t('10 more examples of this challenge.'), Url::fromRoute('captcha_examples', [
+                '#markup' => Link::fromTextAndUrl($this->t('10 more examples of this challenge.'), Url::fromRoute('captcha_examples', [
                   'module' => $module,
                   'challenge' => $challenge,
                 ]))->toString(),
diff --git a/src/Form/CaptchaPointForm.php b/src/Form/CaptchaPointForm.php
index 132bd8e..7c1534c 100755
--- a/src/Form/CaptchaPointForm.php
+++ b/src/Form/CaptchaPointForm.php
@@ -4,6 +4,7 @@ namespace Drupal\captcha\Form;
 
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
 
 /**
  * Entity Form to edit CAPTCHA points.
@@ -48,8 +49,8 @@ class CaptchaPointForm extends EntityForm {
     // Select widget for CAPTCHA type.
     $form['captchaType'] = [
       '#type' => 'select',
-      '#title' => t('Challenge type'),
-      '#description' => t('The CAPTCHA type to use for this form.'),
+      '#title' => $this->t('Challenge type'),
+      '#description' => $this->t('The CAPTCHA type to use for this form.'),
       '#default_value' => ($captcha_point->getCaptchaType() ?: $this->config('captcha.settings')
         ->get('default_challenge')),
       '#options' => _captcha_available_challenge_types(),
diff --git a/src/Tests/CaptchaBaseWebTestCase.php b/src/Tests/CaptchaBaseWebTestCase.php
index c2984f2..f0b3983 100755
--- a/src/Tests/CaptchaBaseWebTestCase.php
+++ b/src/Tests/CaptchaBaseWebTestCase.php
@@ -8,14 +8,16 @@ use Drupal\field\Entity\FieldConfig;
 use Drupal\simpletest\WebTestBase;
 
 /**
- * TODO: write test for CAPTCHAs on admin pages
- * TODO: test for default challenge type
- * TODO: test about placement (comment form, node forms, log in form, etc)
- * TODO: test if captcha_cron does it work right
- * TODO: test custom CAPTCHA validation stuff
- * TODO: test if entry on status report (Already X blocked form submissions)
- * TODO: test space ignoring validation of image CAPTCHA
- * TODO: refactor the 'comment_body[0][value]' stuff.
+ * The TODO List.
+ *
+ * @todo write test for CAPTCHAs on admin pages.
+ * @todo test for default challenge type.
+ * @todo test about placement (comment form, node forms, log in form, etc).
+ * @todo test if captcha_cron does it work right.
+ * @todo test custom CAPTCHA validation stuff.
+ * @todo test if entry on status report (Already X blocked form submissions).
+ * @todo test space ignoring validation of image CAPTCHA.
+ * @todo refactor the 'comment_body[0][value]' stuff.
  */
 
 /**
@@ -43,7 +45,9 @@ abstract class CaptchaBaseWebTestCase extends WebTestBase {
   const CAPTCHA_UNKNOWN_CSID_ERROR_MESSAGE = 'CAPTCHA validation error: unknown CAPTCHA session ID. Contact the site administrator if this problem persists.';
 
   /**
-   * @var [string] Modules to install for this Test class.
+   * Modules to install for this Test class.
+   *
+   * @var [string]ModulestoinstallforthisTestclass
    */
   public static $modules = ['captcha', 'comment'];
 
diff --git a/src/Tests/CaptchaCacheTestCase.php b/src/Tests/CaptchaCacheTestCase.php
index b4baa0e..581e8e9 100644
--- a/src/Tests/CaptchaCacheTestCase.php
+++ b/src/Tests/CaptchaCacheTestCase.php
@@ -10,7 +10,9 @@ namespace Drupal\captcha\Tests;
 class CaptchaCacheTestCase extends CaptchaBaseWebTestCase {
 
   /**
-   * @tag array Modules to install for this Test class.
+   * Modules to install for this Test class.
+   *
+   * @tag array
    */
   public static $modules = ['block', 'image_captcha'];
 
diff --git a/src/Tests/CaptchaCronTestCase.php b/src/Tests/CaptchaCronTestCase.php
index bd381d1..1f457d1 100644
--- a/src/Tests/CaptchaCronTestCase.php
+++ b/src/Tests/CaptchaCronTestCase.php
@@ -13,7 +13,9 @@ use Drupal\simpletest\WebTestBase;
 class CaptchaCronTestCase extends WebTestBase {
 
   /**
-   * @var [string] Modules to install for this Test class.
+   * Modules to install for this Test class.
+   *
+   * @var [string]ModulestoinstallforthisTestclass
    */
   public static $modules = ['captcha'];
 
