Code Duplication    Length = 4-4 lines in 7 locations

code/SecionIO.php 7 locations

@@ 230-233 (lines=4) @@
227
        $success = true;
228
        // check config
229
        $api_url = Config::inst()->get('SectionIO', 'api_url');
230
        if (!isset($api_url) || strlen($api_url) < 1) {
231
            user_error('Value for SectionIO.api_url needs to be configured.', E_USER_WARNING);
232
            $success = false;
233
        }
234
        $account_id = Config::inst()->get('SectionIO', 'account_id');
235
        if (!isset($account_id) || strlen($account_id) < 1) {
236
            user_error('Value for SectionIO.account_id needs to be configured.', E_USER_WARNING);
@@ 235-238 (lines=4) @@
232
            $success = false;
233
        }
234
        $account_id = Config::inst()->get('SectionIO', 'account_id');
235
        if (!isset($account_id) || strlen($account_id) < 1) {
236
            user_error('Value for SectionIO.account_id needs to be configured.', E_USER_WARNING);
237
            $success = false;
238
        }
239
        $application_id = Config::inst()->get('SectionIO', 'application_id');
240
        if (!isset($application_id) || (!is_array($application_id) && strlen((string) $application_id) < 1)) {
241
            user_error('Value for SectionIO.application_id needs to be configured.', E_USER_WARNING);
@@ 240-243 (lines=4) @@
237
            $success = false;
238
        }
239
        $application_id = Config::inst()->get('SectionIO', 'application_id');
240
        if (!isset($application_id) || (!is_array($application_id) && strlen((string) $application_id) < 1)) {
241
            user_error('Value for SectionIO.application_id needs to be configured.', E_USER_WARNING);
242
            $success = false;
243
        }
244
        $environment_name = Config::inst()->get('SectionIO', 'environment_name');
245
        if (!isset($environment_name) || strlen($environment_name) < 1) {
246
            user_error('Value for SectionIO.environment_name needs to be configured.', E_USER_WARNING);
@@ 245-248 (lines=4) @@
242
            $success = false;
243
        }
244
        $environment_name = Config::inst()->get('SectionIO', 'environment_name');
245
        if (!isset($environment_name) || strlen($environment_name) < 1) {
246
            user_error('Value for SectionIO.environment_name needs to be configured.', E_USER_WARNING);
247
            $success = false;
248
        }
249
        $proxy_name = Config::inst()->get('SectionIO', 'proxy_name');
250
        if (!isset($proxy_name) || strlen($proxy_name) < 1) {
251
            user_error('Value for SectionIO.proxy_name needs to be configured.', E_USER_WARNING);
@@ 250-253 (lines=4) @@
247
            $success = false;
248
        }
249
        $proxy_name = Config::inst()->get('SectionIO', 'proxy_name');
250
        if (!isset($proxy_name) || strlen($proxy_name) < 1) {
251
            user_error('Value for SectionIO.proxy_name needs to be configured.', E_USER_WARNING);
252
            $success = false;
253
        }
254
        $username = Config::inst()->get('SectionIO', 'username');
255
        if (!isset($username) || strlen($username) < 1) {
256
            user_error('Value for SectionIO.username needs to be configured.', E_USER_WARNING);
@@ 255-258 (lines=4) @@
252
            $success = false;
253
        }
254
        $username = Config::inst()->get('SectionIO', 'username');
255
        if (!isset($username) || strlen($username) < 1) {
256
            user_error('Value for SectionIO.username needs to be configured.', E_USER_WARNING);
257
            $success = false;
258
        }
259
        $password = Config::inst()->get('SectionIO', 'password');
260
        if (!isset($password) || strlen($password) < 1) {
261
            user_error('Value for SectionIO.password needs to be configured.', E_USER_WARNING);
@@ 260-263 (lines=4) @@
257
            $success = false;
258
        }
259
        $password = Config::inst()->get('SectionIO', 'password');
260
        if (!isset($password) || strlen($password) < 1) {
261
            user_error('Value for SectionIO.password needs to be configured.', E_USER_WARNING);
262
            $success = false;
263
        }
264
265
        return $success;
266
    }