diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php
index 3eb29dd..0115c12 100644
--- a/core/modules/system/entity.api.php
+++ b/core/modules/system/entity.api.php
@@ -355,11 +355,13 @@ function hook_entity_translation_insert(\Drupal\Core\Entity\EntityInterface $tra
  */
 function hook_entity_translation_delete(\Drupal\Core\Entity\EntityInterface $translation) {
   $languages = language_list();
-  $variables = array(
-    '@language' => $languages[$langcode]->name,
-    '@label' => $entity->label(),
-  );
-  watchdog('example', 'The @language translation of @label has just been deleted.', $variables);
+  foreach ($languages as $langcode => $entity) {
+    $variables = array(
+      '@language' => $languages[$langcode]->name,
+      '@label' => $entity->label(),
+    );
+    watchdog('example', 'The @language translation of @label has just been deleted.', $variables);
+  }
 }
 
 /**
diff --git a/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php b/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php
index 3bfad98..099d748 100644
--- a/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php
+++ b/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php
@@ -10,7 +10,6 @@
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\Response;
 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
-use Drupal\Core\Database\Connection;
 use Drupal\system\SystemManager;
 
 /**
diff --git a/core/modules/system/lib/Drupal/system/DateFormatListController.php b/core/modules/system/lib/Drupal/system/DateFormatListController.php
index 673730d..41eb1df 100644
--- a/core/modules/system/lib/Drupal/system/DateFormatListController.php
+++ b/core/modules/system/lib/Drupal/system/DateFormatListController.php
@@ -7,7 +7,6 @@
 
 namespace Drupal\system;
 
-use Drupal\Component\Utility\String;
 use Drupal\Core\Config\Entity\ConfigEntityListController;
 use Drupal\Core\Datetime\Date;
 use Drupal\Core\Entity\EntityInterface;
diff --git a/core/modules/system/lib/Drupal/system/Entity/DateFormat.php b/core/modules/system/lib/Drupal/system/Entity/DateFormat.php
index 5b05252..54eddbe 100644
--- a/core/modules/system/lib/Drupal/system/Entity/DateFormat.php
+++ b/core/modules/system/lib/Drupal/system/Entity/DateFormat.php
@@ -9,7 +9,6 @@
 
 use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\Core\Datetime\DrupalDateTime;
-use Drupal\Core\Entity\EntityStorageControllerInterface;
 use Drupal\system\DateFormatInterface;
 
 /**
diff --git a/core/modules/system/lib/Drupal/system/Form/RegionalForm.php b/core/modules/system/lib/Drupal/system/Form/RegionalForm.php
index 2ca6acf..23cbd67 100644
--- a/core/modules/system/lib/Drupal/system/Form/RegionalForm.php
+++ b/core/modules/system/lib/Drupal/system/Form/RegionalForm.php
@@ -97,7 +97,7 @@ public function buildForm(array $form, array &$form_state) {
       '#options' => $zones,
     );
 
-    $configurable_timezones = $system_date->get('timezone.user.configurable');;
+    $configurable_timezones = $system_date->get('timezone.user.configurable');
     $form['timezone']['configurable_timezones'] = array(
       '#type' => 'checkbox',
       '#title' => t('Users may set their own time zone.'),
diff --git a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemMenuBlock.php b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemMenuBlock.php
index 8298193..a3b24cd 100644
--- a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemMenuBlock.php
+++ b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemMenuBlock.php
@@ -8,7 +8,6 @@
 namespace Drupal\system\Plugin\Block;
 
 use Drupal\block\BlockBase;
-use Drupal\Core\Session\AccountInterface;
 
 /**
  * Provides a generic Menu block.
diff --git a/core/modules/system/lib/Drupal/system/SystemConfigSubscriber.php b/core/modules/system/lib/Drupal/system/SystemConfigSubscriber.php
index 237473a..7b876f9 100644
--- a/core/modules/system/lib/Drupal/system/SystemConfigSubscriber.php
+++ b/core/modules/system/lib/Drupal/system/SystemConfigSubscriber.php
@@ -6,11 +6,8 @@
 
 namespace Drupal\system;
 
-use Drupal\Core\Config\Config;
 use Drupal\Core\Config\ConfigImporterEvent;
 use Drupal\Core\Config\ConfigImporterException;
-use Drupal\Core\Config\ConfigEvent;
-use Drupal\Core\Config\StorageDispatcher;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 
 /**
@@ -28,7 +25,7 @@ static function getSubscribedEvents() {
 
   public function onConfigImporterValidate(ConfigImporterEvent $event) {
     $importer = $event->getConfigImporter();
-    $importList = $importer->getStorageComparer()->getSourceStorage()->listAll();
+    $importerList = $importer->getStorageComparer()->getSourceStorage()->listAll();
     if (empty($importerList)) {
       throw new ConfigImporterException("This import will delete all your active configuration, I'm bailing out now.");
     }
diff --git a/core/modules/system/lib/Drupal/system/SystemManager.php b/core/modules/system/lib/Drupal/system/SystemManager.php
index 07e8c0a..7ccdf55 100644
--- a/core/modules/system/lib/Drupal/system/SystemManager.php
+++ b/core/modules/system/lib/Drupal/system/SystemManager.php
@@ -8,7 +8,6 @@
 
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Entity\EntityManagerInterface;
-use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php
index 2967517..5261187 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php
@@ -7,8 +7,6 @@
 
 namespace Drupal\system\Tests\Ajax;
 
-use Drupal\ajax_test\AjaxTestForm;
-
 /**
  * Tests use of dialogs as wrappers for Ajax responses.
  */
diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/ElementValidationTest.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/ElementValidationTest.php
index 81ed62d..a6e9daa 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Ajax/ElementValidationTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/ElementValidationTest.php
@@ -28,11 +28,10 @@ public static function getInfo() {
    * Ajax-enabled field fails due to the required field being empty.
    */
   function testAjaxElementValidation() {
-    $web_user = $this->drupalCreateUser();
     $edit = array('drivertext' => t('some dumb text'));
 
     // Post with 'drivertext' as the triggering element.
-    $post_result = $this->drupalPostAjaxForm('ajax_validation_test', $edit, 'drivertext');
+    $this->drupalPostAjaxForm('ajax_validation_test', $edit, 'drivertext');
     // Look for a validation failure in the resultant JSON.
     $this->assertNoText(t('Error message'), 'No error message in resultant JSON');
     $this->assertText('ajax_forms_test_validation_form_callback invoked', 'The correct callback was invoked');
@@ -41,7 +40,7 @@ function testAjaxElementValidation() {
     $edit = array('drivernumber' => 12345);
 
     // Post with 'drivernumber' as the triggering element.
-    $post_result = $this->drupalPostAjaxForm('ajax_validation_test', $edit, 'drivernumber');
+    $this->drupalPostAjaxForm('ajax_validation_test', $edit, 'drivernumber');
     // Look for a validation failure in the resultant JSON.
     $this->assertNoText(t('Error message'), 'No error message in resultant JSON');
     $this->assertText('ajax_forms_test_validation_number_form_callback invoked', 'The correct callback was invoked');
diff --git a/core/modules/system/lib/Drupal/system/Tests/Cache/DatabaseBackendUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Cache/DatabaseBackendUnitTest.php
index 3b607a5..762ae86 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Cache/DatabaseBackendUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Cache/DatabaseBackendUnitTest.php
@@ -8,7 +8,6 @@
 namespace Drupal\system\Tests\Cache;
 
 use Drupal\Core\Cache\DatabaseBackend;
-use Drupal\Core\Database\Database;
 
 /**
  * Tests DatabaseBackend using GenericCacheBackendUnitTestBase.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/AddFeedTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/AddFeedTest.php
index b871710..b9dcbb4 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/AddFeedTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/AddFeedTest.php
@@ -70,7 +70,7 @@ function testBasicFeedAddNoTitle() {
       ),
     );
 
-    foreach ($urls as $description => $feed_info) {
+    foreach ($urls as $feed_info) {
       $build['#attached']['drupal_add_feed'][] = array($feed_info['input_url'], $feed_info['title']);
     }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php
index 5c016ce..97b1fc6 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php
@@ -7,7 +7,6 @@
 
 namespace Drupal\system\Tests\Common;
 
-use Drupal\Core\Language\Language;
 use Drupal\simpletest\DrupalUnitTestBase;
 
 /**
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/WriteRecordTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/WriteRecordTest.php
index ee4fe4d..e2aaa40 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/WriteRecordTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/WriteRecordTest.php
@@ -73,7 +73,7 @@ function testDrupalWriteRecord() {
     $person->name = 'Ringo';
     $person->age = NULL;
     $person->job = NULL;
-    $insert_result = drupal_write_record('test', $person);
+    drupal_write_record('test', $person);
     $this->assertTrue(isset($person->id), 'Primary key is set on record created with drupal_write_record().');
     $result = db_query("SELECT * FROM {test} WHERE id = :id", array(':id' => $person->id))->fetchObject();
     $this->assertIdentical($result->name, 'Ringo', 'Name field set.');
@@ -84,7 +84,7 @@ function testDrupalWriteRecord() {
     $person = new \stdClass();
     $person->name = 'Paul';
     $person->age = NULL;
-    $insert_result = drupal_write_record('test_null', $person);
+    drupal_write_record('test_null', $person);
     $this->assertTrue(isset($person->id), 'Primary key is set on record created with drupal_write_record().');
     $result = db_query("SELECT * FROM {test_null} WHERE id = :id", array(':id' => $person->id))->fetchObject();
     $this->assertIdentical($result->name, 'Paul', 'Name field set.');
@@ -93,7 +93,7 @@ function testDrupalWriteRecord() {
     // Insert a record - do not specify the value of a column that allows NULL.
     $person = new \stdClass();
     $person->name = 'Meredith';
-    $insert_result = drupal_write_record('test_null', $person);
+    drupal_write_record('test_null', $person);
     $this->assertTrue(isset($person->id), 'Primary key is set on record created with drupal_write_record().');
     $this->assertIdentical($person->age, 0, 'Age field set to default value.');
     $result = db_query("SELECT * FROM {test_null} WHERE id = :id", array(':id' => $person->id))->fetchObject();
@@ -103,7 +103,7 @@ function testDrupalWriteRecord() {
     // Update the newly created record.
     $person->name = 'Mary';
     $person->age = NULL;
-    $update_result = drupal_write_record('test_null', $person, array('id'));
+    drupal_write_record('test_null', $person, array('id'));
     $result = db_query("SELECT * FROM {test_null} WHERE id = :id", array(':id' => $person->id))->fetchObject();
     $this->assertIdentical($result->name, 'Mary', 'Name field set.');
     $this->assertIdentical($result->age, NULL, 'Age field set.');
@@ -111,20 +111,20 @@ function testDrupalWriteRecord() {
     // Insert a record - the "data" column should be serialized.
     $person = new \stdClass();
     $person->name = 'Dave';
-    $update_result = drupal_write_record('test_serialized', $person);
+    drupal_write_record('test_serialized', $person);
     $result = db_query("SELECT * FROM {test_serialized} WHERE id = :id", array(':id' => $person->id))->fetchObject();
     $this->assertIdentical($result->name, 'Dave', 'Name field set.');
     $this->assertIdentical($result->info, NULL, 'Info field set.');
 
     $person->info = array();
-    $update_result = drupal_write_record('test_serialized', $person, array('id'));
+    drupal_write_record('test_serialized', $person, array('id'));
     $result = db_query("SELECT * FROM {test_serialized} WHERE id = :id", array(':id' => $person->id))->fetchObject();
     $this->assertIdentical(unserialize($result->info), array(), 'Info field updated.');
 
     // Update the serialized record.
     $data = array('foo' => 'bar', 1 => 2, 'empty' => '', 'null' => NULL);
     $person->info = $data;
-    $update_result = drupal_write_record('test_serialized', $person, array('id'));
+    drupal_write_record('test_serialized', $person, array('id'));
     $result = db_query("SELECT * FROM {test_serialized} WHERE id = :id", array(':id' => $person->id))->fetchObject();
     $this->assertIdentical(unserialize($result->info), $data, 'Info field updated.');
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Database/DatabaseTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Database/DatabaseTestBase.php
index 0aa4d5b..da14f5c 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/DatabaseTestBase.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Database/DatabaseTestBase.php
@@ -76,7 +76,7 @@ static function addSampleData() {
       ))
       ->execute();
 
-    $ringo = db_insert('test')
+    db_insert('test')
       ->fields(array(
         'name' => 'Ringo',
         'age' => 28,
diff --git a/core/modules/system/lib/Drupal/system/Tests/Database/SelectOrderedTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/SelectOrderedTest.php
index 62d4d2a..9e20c8a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/SelectOrderedTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Database/SelectOrderedTest.php
@@ -25,7 +25,7 @@ public static function getInfo() {
    */
   function testSimpleSelectOrdered() {
     $query = db_select('test');
-    $name_field = $query->addField('test', 'name');
+    $query->addField('test', 'name');
     $age_field = $query->addField('test', 'age', 'age');
     $query->orderBy($age_field);
     $result = $query->execute();
@@ -46,7 +46,7 @@ function testSimpleSelectOrdered() {
    */
   function testSimpleSelectMultiOrdered() {
     $query = db_select('test');
-    $name_field = $query->addField('test', 'name');
+    $query->addField('test', 'name');
     $age_field = $query->addField('test', 'age', 'age');
     $job_field = $query->addField('test', 'job');
     $query->orderBy($job_field);
@@ -77,7 +77,7 @@ function testSimpleSelectMultiOrdered() {
    */
   function testSimpleSelectOrderedDesc() {
     $query = db_select('test');
-    $name_field = $query->addField('test', 'name');
+    $query->addField('test', 'name');
     $age_field = $query->addField('test', 'age', 'age');
     $query->orderBy($age_field, 'DESC');
     $result = $query->execute();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Database/SelectTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/SelectTest.php
index d9da2d6..ca802c6 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/SelectTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Database/SelectTest.php
@@ -25,8 +25,8 @@ public static function getInfo() {
    */
   function testSimpleSelect() {
     $query = db_select('test');
-    $name_field = $query->addField('test', 'name');
-    $age_field = $query->addField('test', 'age', 'age');
+    $query->addField('test', 'name');
+    $query->addField('test', 'age', 'age');
     $result = $query->execute();
 
     $num_records = 0;
@@ -42,8 +42,8 @@ function testSimpleSelect() {
    */
   function testSimpleComment() {
     $query = db_select('test')->comment('Testing query comments');
-    $name_field = $query->addField('test', 'name');
-    $age_field = $query->addField('test', 'age', 'age');
+    $query->addField('test', 'name');
+    $query->addField('test', 'age', 'age');
     $result = $query->execute();
 
     $num_records = 0;
@@ -63,8 +63,8 @@ function testSimpleComment() {
    */
   function testVulnerableComment() {
     $query = db_select('test')->comment('Testing query comments */ SELECT nid FROM {node}; --');
-    $name_field = $query->addField('test', 'name');
-    $age_field = $query->addField('test', 'age', 'age');
+    $query->addField('test', 'name');
+    $query->addField('test', 'age', 'age');
     $result = $query->execute();
 
     $num_records = 0;
diff --git a/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php b/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php
index 2639f3b..a22f6ff 100644
--- a/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php
@@ -8,8 +8,6 @@
 namespace Drupal\system\Tests\DrupalKernel;
 
 use Drupal\Core\DrupalKernel;
-use Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage;
-use Drupal\Component\PhpStorage\FileReadOnlyStorage;
 use Drupal\simpletest\UnitTestBase;
 
 /**
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
index 536e3b1..031149e 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
@@ -12,7 +12,6 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FieldItemInterface;
 use Drupal\Core\Language\Language;
-use Drupal\Core\TypedData\DataDefinition;
 use Drupal\Core\TypedData\Type\StringInterface;
 use Drupal\Core\TypedData\TypedDataInterface;
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityLanguageTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityLanguageTestBase.php
index ee1c0d0..32ca4dc 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityLanguageTestBase.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityLanguageTestBase.php
@@ -89,7 +89,7 @@ function setUp() {
         'entity_type' => $entity_type,
         'bundle' => $entity_type,
       ))->save();
-      $this->instance[$entity_type] = entity_load('field_instance', $entity_type . '.' . $entity_type . '.' . $this->field_name);;
+      $this->instance[$entity_type] = entity_load('field_instance', $entity_type . '.' . $entity_type . '.' . $this->field_name);
 
       entity_create('field_entity', array(
         'name' => $this->untranslatable_field_name,
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityValidationTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityValidationTest.php
index 4fe1d49..c059a18 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityValidationTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityValidationTest.php
@@ -7,11 +7,6 @@
 
 namespace Drupal\system\Tests\Entity;
 
-use Drupal\Core\Entity\EntityInterface;
-use Drupal\Core\Field\FieldItemListInterface;
-use Drupal\Core\Field\FieldItemInterface;
-use Drupal\Core\TypedData\TypedDataInterface;
-
 /**
  * Tests Entity API base functionality.
  */
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php
index 2c6a159..167a4d9 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php
@@ -8,7 +8,6 @@
 namespace Drupal\system\Tests\Entity;
 
 use Drupal\simpletest\WebTestBase;
-use Drupal\Core\Language\Language;
 
 /**
  * Tests \Drupal\Core\Entity\Controller\EntityViewController.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/ProgrammaticTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ProgrammaticTest.php
index 6753239..e6cdba5 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/ProgrammaticTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/ProgrammaticTest.php
@@ -33,10 +33,6 @@ public static function getInfo() {
    * Test the programmatic form submission workflow.
    */
   function testSubmissionWorkflow() {
-    // Backup the current batch status and reset it to avoid conflicts while
-    // processing the dummy form submit handler.
-    $current_batch = $batch =& batch_get();
-    $batch = array();
 
     // Test that a programmatic form submission is rejected when a required
     // textfield is omitted and correctly processed when it is provided.
@@ -60,9 +56,6 @@ function testSubmissionWorkflow() {
     $this->submitForm(array('op' => 'Submit with limited validation', 'field_to_validate' => 'all'), FALSE);
     $this->submitForm(array('op' => 'Submit with limited validation', 'field_to_validate' => 'textfield'), FALSE);
     $this->submitForm(array('op' => 'Submit with limited validation', 'field_to_validate' => 'field_to_validate'), TRUE);
-
-    // Restore the current batch status.
-    $batch = $current_batch;
   }
 
   /**
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/SystemConfigFormTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/SystemConfigFormTest.php
index 211d1be..1b6d99d 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/SystemConfigFormTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/SystemConfigFormTest.php
@@ -8,7 +8,6 @@
 namespace Drupal\system\Tests\Form;
 
 use Drupal\simpletest\WebTestBase;
-use Drupal\form_test\SystemConfigFormTestForm;
 
 /**
  * Tests the SystemConfigFormTestBase class.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Lock/LockFunctionalTest.php b/core/modules/system/lib/Drupal/system/Tests/Lock/LockFunctionalTest.php
index bf868db..0fa4fb6 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Lock/LockFunctionalTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Lock/LockFunctionalTest.php
@@ -60,7 +60,6 @@ public function testLockAcquire() {
 
     // Check the shut-down function.
     $lock_acquired_exit = 'TRUE: Lock successfully acquired in system_test_lock_exit()';
-    $lock_not_acquired_exit = 'FALSE: Lock not acquired in system_test_lock_exit()';
     $this->drupalGet('system-test/lock-exit');
     $this->assertText($lock_acquired_exit, 'Lock acquired by the other request before exit.', 'Lock');
     $this->assertTrue(lock()->acquire('system_test_lock_exit'), 'Lock acquired by this request after the other request exits.', 'Lock');
diff --git a/core/modules/system/lib/Drupal/system/Tests/ParamConverter/UpcastingTest.php b/core/modules/system/lib/Drupal/system/Tests/ParamConverter/UpcastingTest.php
index f1ff08f..38da044 100644
--- a/core/modules/system/lib/Drupal/system/Tests/ParamConverter/UpcastingTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/ParamConverter/UpcastingTest.php
@@ -7,9 +7,6 @@
 
 namespace Drupal\system\Tests\ParamConverter;
 
-use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
-use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\simpletest\WebTestBase;
 
 /**
diff --git a/core/modules/system/lib/Drupal/system/Tests/Plugin/AlterDecoratorTest.php b/core/modules/system/lib/Drupal/system/Tests/Plugin/AlterDecoratorTest.php
index ce35689..552934e 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Plugin/AlterDecoratorTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Plugin/AlterDecoratorTest.php
@@ -7,9 +7,7 @@
 
 namespace Drupal\system\Tests\Plugin;
 
-use Drupal\Component\Plugin\Exception\ExceptionInterface;
 use Drupal\plugin_test\Plugin\AlterDecoratorTestPluginManager;
-use Drupal\plugin_test\Plugin\TestPluginManager;
 use Drupal\simpletest\WebTestBase;
 
 /**
diff --git a/core/modules/system/lib/Drupal/system/Tests/Plugin/CacheDecoratorTest.php b/core/modules/system/lib/Drupal/system/Tests/Plugin/CacheDecoratorTest.php
index b305d28..abf74a8 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Plugin/CacheDecoratorTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Plugin/CacheDecoratorTest.php
@@ -7,7 +7,6 @@
 
 namespace Drupal\system\Tests\Plugin;
 
-use Drupal\Core\Cache\MemoryBackendFactory;
 use Drupal\Core\Cache\MemoryBackend;
 use Drupal\system\Tests\Plugin\Discovery\DiscoveryTestBase;
 use Drupal\Component\Plugin\Discovery\StaticDiscovery;
diff --git a/core/modules/system/lib/Drupal/system/Tests/Plugin/ContextPluginTest.php b/core/modules/system/lib/Drupal/system/Tests/Plugin/ContextPluginTest.php
index 6f3bd49..748487e 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Plugin/ContextPluginTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Plugin/ContextPluginTest.php
@@ -10,7 +10,6 @@
 use Drupal\simpletest\DrupalUnitTestBase;
 use Drupal\plugin_test\Plugin\MockBlockManager;
 use Drupal\Component\Plugin\Exception\PluginException;
-use Drupal\Component\Plugin\Exception\ContextException;
 
 /**
  * Tests that context aware plugins function correctly.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/RouterTest.php b/core/modules/system/lib/Drupal/system/Tests/Routing/RouterTest.php
index 25d3de0..b36252c 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Routing/RouterTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Routing/RouterTest.php
@@ -8,7 +8,6 @@
 namespace Drupal\system\Tests\Routing;
 
 use Drupal\simpletest\WebTestBase;
-use Symfony\Component\Routing\RequestContext;
 
 /**
  * Functional class for the full integrated routing system.
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/CronQueueTest.php b/core/modules/system/lib/Drupal/system/Tests/System/CronQueueTest.php
index c62d519..2bbd872 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/CronQueueTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/CronQueueTest.php
@@ -7,10 +7,6 @@
 
 namespace Drupal\system\Tests\System;
 
-use Drupal\Core\Database\Database;
-use Drupal\Core\Queue\DatabaseQueue;
-use Drupal\Core\Queue\Memory;
-use Drupal\simpletest\DrupalUnitTestBase;
 use Drupal\simpletest\WebTestBase;
 
 /**
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsMachineNameTest.php b/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsMachineNameTest.php
index da2fa0b..495ab87 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsMachineNameTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsMachineNameTest.php
@@ -7,7 +7,6 @@
 
 namespace Drupal\system\Tests\System;
 
-use Drupal\Component\Datetime\DateTimePlus;
 use Drupal\Component\Utility\Unicode;
 use Drupal\simpletest\WebTestBase;
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php b/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php
index 336c2cb..f017faf 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php
@@ -52,7 +52,7 @@ public function testDrupalFrontPage() {
       'title' => $this->randomName(8),
       'promote' => 1,
     );
-    $node = $this->drupalCreateNode($settings);
+    $this->drupalCreateNode($settings);
     $this->drupalGet('');
     $this->assertTitle('Home | Drupal');
 
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index fc6f61c..aad04d0 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -5,14 +5,11 @@
  * Configuration system that lets administrators modify the workings of the site.
  */
 
-use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Utility\ModuleInfo;
 use Drupal\user\UserInterface;
-use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\RedirectResponse;
-use Symfony\Component\HttpFoundation\Response;
 use Guzzle\Http\Exception\BadResponseException;
 use Guzzle\Http\Exception\RequestException;
 
diff --git a/core/modules/system/tests/Drupal/system/Tests/Transliteration/MachineNameControllerTest.php b/core/modules/system/tests/Drupal/system/Tests/Transliteration/MachineNameControllerTest.php
index 8eb2592..fddac33 100644
--- a/core/modules/system/tests/Drupal/system/Tests/Transliteration/MachineNameControllerTest.php
+++ b/core/modules/system/tests/Drupal/system/Tests/Transliteration/MachineNameControllerTest.php
@@ -8,7 +8,6 @@
 namespace Drupal\system\Tests\Transliteration;
 
 use Drupal\Tests\UnitTestCase;
-use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Component\Transliteration\PHPTransliteration;
 use Drupal\system\MachineNameController;
 use Symfony\Component\HttpFoundation\Request;
diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php
index a6a42ee..cf37c89 100644
--- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php
+++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php
@@ -7,7 +7,6 @@
 
 namespace Drupal\entity_test\Controller;
 
-use Drupal\Core\Entity\EntityInterface;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php
index 9798c4f..049fabd 100644
--- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php
+++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php
@@ -10,7 +10,6 @@
 use Drupal\Core\Entity\ContentEntityBase;
 use Drupal\Core\Field\FieldDefinition;
 use Drupal\Core\Entity\EntityStorageControllerInterface;
-use Drupal\Core\Language\Language;
 
 /**
  * Defines the test entity class.
diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestCache.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestCache.php
index 460b2e7..a6cedc4 100644
--- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestCache.php
+++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestCache.php
@@ -7,7 +7,6 @@
 
 namespace Drupal\entity_test\Entity;
 
-use Drupal\Core\Language\Language;
 
 /**
  * Defines the test entity class.
diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module
index ecdbc76..35d4a76 100644
--- a/core/modules/system/tests/modules/form_test/form_test.module
+++ b/core/modules/system/tests/modules/form_test/form_test.module
@@ -5,12 +5,9 @@
  * Helper module for the form API tests.
  */
 
-use Drupal\Core\Database\Connection;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Language\Language;
 use Drupal\form_test\Callbacks;
-use Drupal\form_test\FormTestObject;
-use Drupal\form_test\SystemConfigFormTestForm;
 use Drupal\Core\Datetime\DrupalDateTime;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
diff --git a/core/modules/system/tests/modules/menu_test/lib/Drupal/menu_test/EventSubscriber/ActiveTrailSubscriber.php b/core/modules/system/tests/modules/menu_test/lib/Drupal/menu_test/EventSubscriber/ActiveTrailSubscriber.php
index 04c79c1..5b63e55 100644
--- a/core/modules/system/tests/modules/menu_test/lib/Drupal/menu_test/EventSubscriber/ActiveTrailSubscriber.php
+++ b/core/modules/system/tests/modules/menu_test/lib/Drupal/menu_test/EventSubscriber/ActiveTrailSubscriber.php
@@ -7,7 +7,6 @@
 
 namespace Drupal\menu_test\EventSubscriber;
 
-use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Drupal\Core\KeyValueStore\StateInterface;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 use Symfony\Component\HttpKernel\Event\GetResponseEvent;
diff --git a/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/TestPluginManager.php b/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/TestPluginManager.php
index 85fabeb..adffdef 100644
--- a/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/TestPluginManager.php
+++ b/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/TestPluginManager.php
@@ -9,7 +9,6 @@
 
 use Drupal\Component\Plugin\PluginManagerBase;
 use Drupal\Component\Plugin\Discovery\StaticDiscovery;
-use Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator;
 use Drupal\Component\Plugin\Factory\DefaultFactory;
 
 /**
diff --git a/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/plugin_test/mock_block/MockUserNameBlock.php b/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/plugin_test/mock_block/MockUserNameBlock.php
index 3fc1f84..9150167 100644
--- a/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/plugin_test/mock_block/MockUserNameBlock.php
+++ b/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/plugin_test/mock_block/MockUserNameBlock.php
@@ -8,7 +8,6 @@
 namespace Drupal\plugin_test\Plugin\plugin_test\mock_block;
 
 use Drupal\Core\Plugin\ContextAwarePluginBase;
-use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
 
 /**
  * Implementation of a user name block plugin used by Plugin API context test.
diff --git a/core/modules/system/tests/modules/router_test_directory/lib/Drupal/router_test/TestContent.php b/core/modules/system/tests/modules/router_test_directory/lib/Drupal/router_test/TestContent.php
index 71d095c..eca8258 100644
--- a/core/modules/system/tests/modules/router_test_directory/lib/Drupal/router_test/TestContent.php
+++ b/core/modules/system/tests/modules/router_test_directory/lib/Drupal/router_test/TestContent.php
@@ -10,7 +10,6 @@
 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
 use Drupal\user\UserInterface;
 use Symfony\Component\DependencyInjection\ContainerAware;
-use Symfony\Component\DependencyInjection\ContainerAwareInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\HttpKernelInterface;
diff --git a/core/modules/system/tests/modules/twig_extension_test/lib/Drupal/twig_extension_test/TwigExtension/TestExtension.php b/core/modules/system/tests/modules/twig_extension_test/lib/Drupal/twig_extension_test/TwigExtension/TestExtension.php
index 93da633..3c2b851 100644
--- a/core/modules/system/tests/modules/twig_extension_test/lib/Drupal/twig_extension_test/TwigExtension/TestExtension.php
+++ b/core/modules/system/tests/modules/twig_extension_test/lib/Drupal/twig_extension_test/TwigExtension/TestExtension.php
@@ -8,7 +8,6 @@
 namespace Drupal\twig_extension_test\TwigExtension;
 
 use Drupal\Core\Template\TwigExtension;
-use Drupal\Core\Template\TwigReferenceFunction;
 
 /**
  * A test Twig extension that adds a custom function and a custom filter.
diff --git a/core/tests/Drupal/Tests/Core/Routing/MimeTypeMatcherTest.php b/core/tests/Drupal/Tests/Core/Routing/MimeTypeMatcherTest.php
index b407fe8..49593a8 100644
--- a/core/tests/Drupal/Tests/Core/Routing/MimeTypeMatcherTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/MimeTypeMatcherTest.php
@@ -106,7 +106,7 @@ public function testNoRouteFound() {
     // This should throw NotAcceptableHttpException.
     $request = Request::create('path/two', 'GET');
     $request->headers->set('Accept', 'application/json, text/xml;q=0.9');
-    $routes = $matcher->filter($routes, $request);
+    $matcher->filter($routes, $request);
   }
 
 }
