Code Duplication    Length = 3-7 lines in 2 locations

includes/class-wpinv-reports.php 2 locations

@@ 171-173 (lines=3) @@
168
            if ( $is_dir && $is_writeable ) {
169
               return true;
170
            } else if ( $is_dir && !$is_writeable ) {
171
               if ( !$this->wp_filesystem->chmod( $this->export_dir, FS_CHMOD_DIR ) ) {
172
                   return wp_sprintf( __( 'Filesystem ERROR: Export location %s is not writable, check your file permissions.', 'invoicing' ), $this->export_dir );
173
               }
174
               
175
               return true;
176
            } else {
@@ 176-182 (lines=7) @@
173
               }
174
               
175
               return true;
176
            } else {
177
                if ( !$this->wp_filesystem->mkdir( $this->export_dir, FS_CHMOD_DIR ) ) {
178
                    return wp_sprintf( __( 'Filesystem ERROR: Could not create directory %s. This is usually due to inconsistent file permissions.', 'invoicing' ), $this->export_dir );
179
                }
180
                
181
                return true;
182
            }
183
        } catch ( Exception $e ) {
184
            return $e->getMessage();
185
        }