Completed
Push — try/maps+view ( f589b1 )
by
unknown
07:29
created

blocks.php ➔ jetpack_map_load_assets()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
1
<?php
2
/*
3
 * Load code specific to some Guternberg blocks
4
 * This file is special, and is not an actual `module` as such.
5
 * It is included by ./module-extras.php
6
 */
7
8
jetpack_register_block(
9
	'map',
10
	array(
11
		'render_callback' => 'jetpack_map_load_assets',
12
	)
13
);
14
15
function jetpack_map_load_assets( $attr, $content ) {
16
	$maps_dependencies = array(
0 ignored issues
show
Unused Code introduced by
$maps_dependencies is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
17
		'wp-element',
18
		'wp-i18n',
19
		'wp-api-fetch',
20
	);
21
	Jetpack_Gutenberg::load_assets_as_required( 'map', $map_dependencies );
0 ignored issues
show
Bug introduced by
The variable $map_dependencies does not exist. Did you mean $maps_dependencies?

This check looks for variables that are accessed but have not been defined. It raises an issue if it finds another variable that has a similar name.

The variable may have been renamed without also renaming all references.

Loading history...
22
	return $content;
23
}
24