Code Duplication    Length = 5-13 lines in 2 locations

maintenance/refreshImageMetadata.php 2 locations

@@ 148-160 (lines=13) @@
145
					$upgraded++;
146
					$newLength = strlen( $file->getMetadata() );
147
					$oldLength = strlen( $row->img_metadata );
148
					if ( $newLength < $oldLength - 5 ) {
149
						// If after updating, the metadata is smaller then
150
						// what it was before, that's probably not a good thing
151
						// because we extract more data with time, not less.
152
						// Thus this probably indicates an error of some sort,
153
						// or at the very least is suspicious. Have the - 5 just
154
						// to weed out any inconsequential changes.
155
						$error++;
156
						$this->output( "Warning: File:{$row->img_name} used to have " .
157
							"$oldLength bytes of metadata but now has $newLength bytes.\n" );
158
					} elseif ( $verbose ) {
159
						$this->output( "Refreshed File:{$row->img_name}.\n" );
160
					}
161
				} else {
162
					$leftAlone++;
163
					if ( $force ) {
@@ 167-171 (lines=5) @@
164
						$file->upgradeRow();
165
						$newLength = strlen( $file->getMetadata() );
166
						$oldLength = strlen( $row->img_metadata );
167
						if ( $newLength < $oldLength - 5 ) {
168
							$error++;
169
							$this->output( "Warning: File:{$row->img_name} used to have " .
170
								"$oldLength bytes of metadata but now has $newLength bytes. (forced)\n" );
171
						}
172
						if ( $verbose ) {
173
							$this->output( "Forcibly refreshed File:{$row->img_name}.\n" );
174
						}