Code Duplication    Length = 4-9 lines in 2 locations

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

@@ 627-630 (lines=4) @@
624
625
			// If this is a module option and the related module isn't active for any reason, continue with the next one.
626
			if ( 'settings' !== $option_attrs['jp_group'] ) {
627
				if ( ! Jetpack::is_module( $option_attrs['jp_group'] ) ) {
628
					$not_updated[ $option ] = esc_html__( 'The requested Jetpack module was not found.', 'jetpack' );
629
					continue;
630
				}
631
632
				if (
633
					'any' !== $request['slug']
@@ 632-640 (lines=9) @@
629
					continue;
630
				}
631
632
				if (
633
					'any' !== $request['slug']
634
					&& ! Jetpack::is_module_active( $option_attrs['jp_group'] )
635
				) {
636
637
					// We only take note of skipped options when updating one module
638
					$not_updated[ $option ] = esc_html__( 'The requested Jetpack module is inactive.', 'jetpack' );
639
					continue;
640
				}
641
			}
642
643
			// Properly cast value based on its type defined in endpoint accepted args.