Code Duplication    Length = 8-11 lines in 2 locations

modules/pwa/class.jetpack-pwa-service-worker.php 1 location

@@ 186-193 (lines=8) @@
183
		// resolve asset dependencies and capture URLs
184
		global $wp_scripts;
185
		$wp_scripts->all_deps( $wp_scripts->queue, true );
186
		foreach( $wp_scripts->to_do as $handle ) {
187
			$registration = $wp_scripts->registered[$handle];
188
			$url = apply_filters( 'script_loader_src', $registration->src, $handle );
189
			if ( $registration->ver ) {
190
				$url = add_query_arg( 'ver', $registration->ver, $url );
191
			}
192
			$asset_urls[] = $url;
193
		}
194
195
		global $wp_styles;
196
		$wp_styles->all_deps( $wp_styles->queue, true );

modules/perf/class.jetpack-perf-optimize-assets.php 1 location

@@ 162-172 (lines=11) @@
159
160
		// fetch all deps for head
161
		$wp_scripts->all_deps( $wp_scripts->queue, true, 1 );
162
		foreach( $wp_scripts->to_do as $handle ) {
163
			$registration = $wp_scripts->registered[$handle];
164
			if ( $registration->args !== NULL ) {
165
				// skip, this asset has an explicit location
166
				continue;
167
			}
168
169
			$asset_group = apply_filters( 'jetpack_perf_asset_group', 1, $handle );
170
			$registration->args = $asset_group;
171
			$wp_scripts->groups[$handle] = $asset_group;
172
		}
173
	}
174
175
	// scripts that run after CSS <link>s in the header block waiting for the CSS to load