Code Duplication    Length = 4-9 lines in 2 locations

_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php 2 locations

@@ 590-593 (lines=4) @@
587
588
			// If this is a module option and the related module isn't active for any reason, continue with the next one.
589
			if ( 'settings' !== $option_attrs['jp_group'] ) {
590
				if ( ! Jetpack::is_module( $option_attrs['jp_group'] ) ) {
591
					$not_updated[ $option ] = esc_html__( 'The requested Jetpack module was not found.', 'jetpack' );
592
					continue;
593
				}
594
595
				if (
596
					'any' !== $request['slug']
@@ 595-603 (lines=9) @@
592
					continue;
593
				}
594
595
				if (
596
					'any' !== $request['slug']
597
					&& ! Jetpack::is_module_active( $option_attrs['jp_group'] )
598
				) {
599
600
					// We only take note of skipped options when updating one module
601
					$not_updated[ $option ] = esc_html__( 'The requested Jetpack module is inactive.', 'jetpack' );
602
					continue;
603
				}
604
			}
605
606
			// Properly cast value based on its type defined in endpoint accepted args.