| Conditions | 3 |
| Paths | 4 |
| Total Lines | 92 |
| Code Lines | 85 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php namespace Rollbar; |
||
| 21 | public function __construct($utilities) |
||
| 22 | { |
||
| 23 | $this->data = array(); |
||
| 24 | |||
| 25 | $this->data['psrLevels'] = array( |
||
| 26 | LogLevel::EMERGENCY => "critical", |
||
| 27 | "emergency" => "critical", |
||
| 28 | LogLevel::ALERT => "critical", |
||
| 29 | "alert" => "critical", |
||
| 30 | LogLevel::CRITICAL => "critical", |
||
| 31 | "critical" => "critical", |
||
| 32 | LogLevel::ERROR => "error", |
||
| 33 | "error" => "error", |
||
| 34 | LogLevel::WARNING => "warning", |
||
| 35 | "warning" => "warning", |
||
| 36 | LogLevel::NOTICE => "info", |
||
| 37 | "notice" => "info", |
||
| 38 | LogLevel::INFO => "info", |
||
| 39 | "info" => "info", |
||
| 40 | LogLevel::DEBUG => "debug", |
||
| 41 | "debug" => "debug" |
||
| 42 | ); |
||
| 43 | $this->data['errorLevels'] = array( |
||
| 44 | E_ERROR => "error", |
||
| 45 | E_WARNING => "warning", |
||
| 46 | E_PARSE => "critical", |
||
| 47 | E_NOTICE => "debug", |
||
| 48 | E_CORE_ERROR => "critical", |
||
| 49 | E_CORE_WARNING => "warning", |
||
| 50 | E_COMPILE_ERROR => "critical", |
||
| 51 | E_COMPILE_WARNING => "warning", |
||
| 52 | E_USER_ERROR => "error", |
||
| 53 | E_USER_WARNING => "warning", |
||
| 54 | E_USER_NOTICE => "debug", |
||
| 55 | E_STRICT => "info", |
||
| 56 | E_RECOVERABLE_ERROR => "error", |
||
| 57 | E_DEPRECATED => "info", |
||
| 58 | E_USER_DEPRECATED => "info" |
||
| 59 | ); |
||
| 60 | $this->data['gitHash'] = null; |
||
| 61 | $this->data['gitBranch'] = null; |
||
| 62 | $this->data['serverRoot'] = isset($_ENV["HEROKU_APP_DIR"]) ? $_ENV["HEROKU_APP_DIR"] : null; |
||
| 63 | $this->data['platform'] = php_uname('a'); |
||
| 64 | $this->data['notifier'] = Notifier::defaultNotifier(); |
||
| 65 | $this->data['baseException'] = version_compare(phpversion(), '7.0', '<') ? '\Exception' : '\Throwable'; |
||
| 66 | $this->data['codeVersion'] = ""; |
||
| 67 | $this->data['sendMessageTrace'] = false; |
||
| 68 | $this->data['includeCodeContext'] = false; |
||
| 69 | $this->data['includeExcCodeContext'] = false; |
||
| 70 | $this->data['rawRequestBody'] = false; |
||
| 71 | $this->data['localVarsDump'] = true; |
||
| 72 | $this->data['errorSampleRates'] = array(); |
||
| 73 | $this->data['exceptionSampleRates'] = array(); |
||
| 74 | $this->data['includedErrno'] = ROLLBAR_INCLUDED_ERRNO_BITMASK; |
||
| 75 | $this->data['includeErrorCodeContext'] = null; |
||
| 76 | $this->data['includeExceptionCodeContext'] = null; |
||
| 77 | $this->data['agentLogLocation'] = '/var/tmp'; |
||
| 78 | $this->data['allowExec'] = true; |
||
| 79 | $this->data['messageLevel'] = "warning"; |
||
| 80 | $this->data['exceptionLevel'] = "error"; |
||
| 81 | $this->data['endpoint'] = 'https://api.rollbar.com/api/1/'; |
||
| 82 | $this->data['captureErrorStacktraces'] = true; |
||
| 83 | $this->data['checkIgnore'] = null; |
||
| 84 | $this->data['custom'] = null; |
||
| 85 | $this->data['customDataMethod'] = null; |
||
| 86 | $this->data['enabled'] = true; |
||
| 87 | $this->data['environment'] = 'production'; |
||
| 88 | $this->data['fluentHost'] = '127.0.0.1'; |
||
| 89 | $this->data['fluentPort'] = 24224; |
||
| 90 | $this->data['fluentTag'] = 'rollbar'; |
||
| 91 | $this->data['handler'] = 'blocking'; |
||
| 92 | $this->data['host'] = null; |
||
| 93 | $this->data['timeout'] = 3; |
||
| 94 | $this->data['reportSuppressed'] = false; |
||
| 95 | $this->data['useErrorReporting'] = false; |
||
| 96 | $this->data['verbosity'] = \Psr\Log\LogLevel::ERROR; |
||
| 97 | $this->data['captureIP'] = true; |
||
| 98 | $this->data['captureEmail'] = false; |
||
| 99 | $this->data['captureUsername'] = false; |
||
| 100 | $this->data['scrubFields'] = array( |
||
| 101 | 'passwd', |
||
| 102 | 'password', |
||
| 103 | 'secret', |
||
| 104 | 'confirm_password', |
||
| 105 | 'password_confirmation', |
||
| 106 | 'auth_token', |
||
| 107 | 'csrf_token', |
||
| 108 | 'access_token' |
||
| 109 | ); |
||
| 110 | $this->data['customTruncation'] = null; |
||
| 111 | |||
| 112 | $this->utilities = $utilities; |
||
| 113 | } |
||
| 164 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths