diff --git a/core/lib/Drupal/Component/Gettext/PoHeader.php b/core/lib/Drupal/Component/Gettext/PoHeader.php
index 44959eb971be3af79db4a42503c289c1d43911c4..865231ee0d5be9772ee153ff3883731b72d661bd 100644
--- a/core/lib/Drupal/Component/Gettext/PoHeader.php
+++ b/core/lib/Drupal/Component/Gettext/PoHeader.php
@@ -327,7 +327,6 @@ private function parseArithmetic($string) {
       for ($i = 2; $i < count($element_stack); $i++) {
         $op = $element_stack[$i];
         if (!empty($precedence[$op])) {
-          $f = "";
           if ($op == ":") {
             $f = $element_stack[$i - 2] . "):" . $element_stack[$i - 1] . ")";
           }
diff --git a/core/modules/content_translation/content_translation.pages.inc b/core/modules/content_translation/content_translation.pages.inc
index f6e6698f700c8c8c5c3ed3c7295a94419498789f..e08a498f1b8f59102d133af4add43c63ad91f88d 100644
--- a/core/modules/content_translation/content_translation.pages.inc
+++ b/core/modules/content_translation/content_translation.pages.inc
@@ -33,12 +33,6 @@ function content_translation_overview(EntityInterface $entity) {
   $rows = array();
 
   if (language_multilingual()) {
-    // If we have a view path defined for the current entity get the switch
-    // links based on it.
-    if ($path) {
-      $links = _content_translation_get_switch_links($path);
-    }
-
     // Determine whether the current entity is translatable.
     $translatable = FALSE;
     foreach (field_info_instances($entity->entityType(), $entity->bundle()) as $instance) {
@@ -74,7 +68,6 @@ function content_translation_overview(EntityInterface $entity) {
         // Existing translation in the translation set: display status.
         $source = isset($entity->translation[$langcode]['source']) ? $entity->translation[$langcode]['source'] : '';
         $is_original = $langcode == $original;
-        $translation = $translations[$langcode];
         $label = $entity->label($langcode);
         $link = isset($links->links[$langcode]['href']) ? $links->links[$langcode] : array('href' => $path, 'language' => $language);
         $row_title = l($label, $link['href'], $link);
@@ -202,7 +195,6 @@ function content_translation_add_page(EntityInterface $entity, Language $source
   $form_state['langcode'] = $target->id;
   $form_state['content_translation']['source'] = $source;
   $form_state['content_translation']['target'] = $target;
-  $controller = content_translation_controller($entity->entityType());
   $form_state['content_translation']['translation_form'] = !$entity->access('update');
   return \Drupal::entityManager()->getForm($entity, $operation, $form_state);
 }
@@ -253,7 +245,6 @@ function content_translation_prepare_translation(EntityInterface $entity, Langua
  * @deprecated Use \Drupal\content_translation\Form\ContentTranslationForm::deleteTranslation()
  */
 function content_translation_delete_confirm(array $form, array $form_state, EntityInterface $entity, Language $language) {
-  $langcode = $language->id;
   $controller = content_translation_controller($entity->entityType());
 
   return confirm_form(
diff --git a/core/modules/image/image.module b/core/modules/image/image.module
index 76d0bd74539db0cde8192f8a291a986535029a18..0051df821be5c0e8c92f3f1d538cbdc1d50885d1 100644
--- a/core/modules/image/image.module
+++ b/core/modules/image/image.module
@@ -216,12 +216,9 @@ function image_file_download($uri) {
   // Private file access for image style derivatives.
   if (strpos($path, 'styles/') === 0) {
     $args = explode('/', $path);
-    // Discard the first part of the path (styles).
-    array_shift($args);
-    // Get the style name from the second part.
-    $style_name = array_shift($args);
-    // Remove the scheme from the path.
-    array_shift($args);
+
+    // Discard "styles", style name, and scheme from the path
+    $args = array_slice($args, 3);
 
     // Then the remaining parts are the path to the image.
     $original_uri = file_uri_scheme($uri) . '://' . implode('/', $args);
diff --git a/core/modules/options/options.module b/core/modules/options/options.module
index 5ab2241549eb9c44e08ed6c32e1d8a6cb73f248e..72d359d8fd4267ccc789f29ab154f6c0dd6366eb 100644
--- a/core/modules/options/options.module
+++ b/core/modules/options/options.module
@@ -295,7 +295,7 @@ function options_extract_allowed_values($string, $field_type, $generate_keys) {
 
   $generated_keys = $explicit_keys = FALSE;
   foreach ($list as $position => $text) {
-    $value = $key = FALSE;
+    $key = FALSE;
 
     // Check for an explicit key.
     $matches = array();
diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module
index 0753007fdbc07f05fb57682148210bbf3e47f4f8..912e29dc8a530cd44580d09b3109463a262f3447 100644
--- a/core/modules/overlay/overlay.module
+++ b/core/modules/overlay/overlay.module
@@ -460,7 +460,6 @@ function overlay_get_mode() {
  * @see \Drupal\overlay\EventSubscriber\OverlaySubscriber::onRequest()
  */
 function overlay_set_mode($mode = NULL) {
-  global $base_path;
   // We're not using drupal_static() here since the static cache is reset in
   // drupal_flush_all_caches(); this could lead to the loss of the overlay when
   // submitting the admin/modules form, for instance.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityRevisionsTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityRevisionsTest.php
index 6173cda758cb7ec49a3dce25cea73dcb98b297f6..a6066c6bf77655a36e2ab0813eeeeb1b34179d27 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityRevisionsTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityRevisionsTest.php
@@ -69,7 +69,6 @@ protected function assertRevisions($entity_type) {
     $entity->field_test_text->value = 'bar';
     $entity->save();
 
-    $entities = array();
     $names = array();
     $texts = array();
     $revision_ids = array();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php
index 951d7c00d06794ada606d92758f5ab845e2d1765..4aa8eb8010600ed78b034c25d692d1b3c0be4ea2 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php
@@ -238,7 +238,7 @@ function testRequiredCheckboxesRadio() {
    */
   function testRequiredTextfieldNoTitle() {
     $form = $form_state = array();
-    $form = form_test_validate_required_form_no_title($form, $form_state);
+    form_test_validate_required_form_no_title($form, $form_state);
 
     // Attempt to submit the form with no required field set.
     $edit = array();
@@ -528,7 +528,7 @@ function testDisabledElements() {
 
     // Ensure that the returned values match the form's default values in both
     // cases.
-    foreach ($returned_values as $type => $values) {
+    foreach ($returned_values as $values) {
       $this->assertFormValuesDefault($values, $form);
     }
   }
diff --git a/core/modules/system/tests/modules/database_test/database_test.module b/core/modules/system/tests/modules/database_test/database_test.module
index 8710c5535817736c4c3f530ed6dc70334ec8e93c..f41ad30b053bb9a76be457dfe44e12ad77272121 100644
--- a/core/modules/system/tests/modules/database_test/database_test.module
+++ b/core/modules/system/tests/modules/database_test/database_test.module
@@ -15,7 +15,7 @@ function database_test_query_alter(AlterableInterface $query) {
 
   if ($query->hasTag('database_test_alter_add_join')) {
     $people_alias = $query->join('test', 'people', "test_task.pid = %alias.id");
-    $name_field = $query->addField($people_alias, 'name', 'name');
+    $query->addField($people_alias, 'name', 'name');
     $query->condition($people_alias . '.id', 2);
   }
 
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
index 09f178de9d025b8ea0933d33049770454d49b856..5f81565ff53c8b731e0c133f5c7681e5c137faab 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
@@ -165,7 +165,6 @@ public function form(array $form, array &$form_state) {
         '#type' => 'container',
         '#id' => 'edit-display-settings',
       );
-      $display_title = $this->getDisplayLabel($view, $display_id, FALSE);
 
       // Add a text that the display is disabled.
       if ($view->getExecutable()->displayHandlers->has($display_id)) {
@@ -330,7 +329,6 @@ public function getDisplayTab($view) {
     // If the plugin doesn't exist, display an error message instead of an edit
     // page.
     if (empty($display)) {
-      $title = isset($display->display['display_title']) ? $display->display['display_title'] : $this->t('Invalid');
       // @TODO: Improved UX for the case where a plugin is missing.
       $build['#markup'] = $this->t("Error: Display @display refers to a plugin named '@plugin', but that plugin is not available.", array('@display' => $display->display['id'], '@plugin' => $display->display['display_plugin']));
     }
@@ -899,7 +897,6 @@ public function getFormBucket(ViewUI $view, $type, $display) {
     $build['#name'] = $build['#title'] = $types[$type]['title'];
 
     $rearrange_url = "admin/structure/views/nojs/rearrange/{$view->id()}/{$display['id']}/$type";
-    $rearrange_text = $this->t('Rearrange');
     $class = 'icon compact rearrange';
 
     // Different types now have different rearrange forms, so we use this switch
@@ -909,7 +906,6 @@ public function getFormBucket(ViewUI $view, $type, $display) {
         // The rearrange form for filters contains the and/or UI, so override
         // the used path.
         $rearrange_url = "admin/structure/views/nojs/rearrange-filter/{$view->id()}/{$display['id']}";
-        $rearrange_text = $this->t('And/Or, Rearrange');
         // TODO: Add another class to have another symbol for filter rearrange.
         $class = 'icon compact rearrange';
         break;