GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 81a8a0...75582b )
by Vincent
11:02 queued 02:43
created

Stash   A

Complexity

Total Complexity 21

Size/Duplication

Total Lines 158
Duplicated Lines 4.43 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 7
loc 158
rs 10
c 1
b 0
f 0
wmc 21
lcom 1
cbo 2

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * Stash includes
4
 *
5
 * The $stash_includes array determines the code library included in your theme.
6
 * Add or remove files to the array as needed. Supports child theme overrides.
7
 */
8
$stash_includes = [
9
    'lib/timber.php',     // Twig magic
10
    'lib/assets.php',     // Scripts and stylesheets
11
    'lib/extras.php',     // Custom functions
12
    'lib/setup.php',      // Theme setup
13
    'lib/images.php',     // Helper for retrieving Images
14
    'lib/custom.php',     // Load custom post types and taxonomies
15
    'lib/acf.php',        // Functions related to ACF
16
    'lib/transients.php', // Clear all transients on database changes
17
];
18
19
foreach ($stash_includes as $file) {
20
    if (!$filepath = locate_template($file)) {
21
        trigger_error(sprintf(__('Error locating %s for inclusion', 'stash'), $file), E_USER_ERROR);
22
    }
23
24
    require_once $filepath;
25
}
26
unset($file, $filepath);
27