Code Duplication    Length = 6-11 lines in 3 locations

_inc/lib/debugger/debug-functions.php 3 locations

@@ 64-71 (lines=8) @@
61
					return;
62
				}
63
				if ( false === $results['pass'] ) {
64
					if ( $results['label'] ) {
65
						// `test__check_if_connected` is the only test that is properly using a label.
66
						$return['label'] = $results['label'];
67
					} else {
68
						// All other tests pass message as label.
69
						// TODO: fix it so all tests use label.
70
						$return['label'] = $results['message'];
71
					}
72
73
					if ( $results['resolution'] ) {
74
						// Most tests pass a `resolution` property to use as a description.
@@ 73-83 (lines=11) @@
70
						$return['label'] = $results['message'];
71
					}
72
73
					if ( $results['resolution'] ) {
74
						// Most tests pass a `resolution` property to use as a description.
75
						$return['description'] = sprintf(
76
							'<p>%s</p>',
77
							$results['resolution']
78
						);
79
					} else {
80
						// `test__check_if_connected` uses 'message' property for description.
81
						// TODO: remove 'resolution' property in favor of a consistent 'message' or even 'description'.
82
						$return['description'] = $results['message'];
83
					}
84
85
					$return['status'] = $results['severity'];
86
					if ( ! empty( $results['action'] ) ) {
@@ 95-100 (lines=6) @@
92
							__( '(opens in a new tab)', 'jetpack' )
93
						);
94
					}
95
				} elseif ( true === $results['pass'] ) {
96
					$return['description'] = $results['message'];
97
					if ( $results['label'] ) {
98
						$return['label'] = $results['label'];
99
					}
100
				}
101
102
				return $return;
103
			},