Method add_logline
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Wontfix
public function add_logline($message, int $severity, string $category = NULL, array $params = array())
{
try {
if ($this->buffer_size < Constants::MAX_LOG_BUFFER_SIZE) {
// Validate message
Method __construct
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Wontfix
public function __construct(array $params, bool $sync_time = true)
{
try {
// Initialize parameters
$this->configured = false;
Function add_logline
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Wontfix
public function add_logline($message, int $severity, string $category = NULL, array $params = array())
{
try {
if ($this->buffer_size < Constants::MAX_LOG_BUFFER_SIZE) {
// Validate message
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function msg2str
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Wontfix
public function msg2str($message): string
{
try {
// Format message content according to it's type
if (is_string($message)) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method send_bulk
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Wontfix
private function send_bulk(bool $time_sync = true)
{
try {
// Check if current logger manager is configured
if (!$this->configured) return;
Function run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Wontfix
public function run()
{
try {
// Execute while thread not stopped
while (true) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function send_bulk
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Wontfix
private function send_bulk(bool $time_sync = true)
{
try {
// Check if current logger manager is configured
if (!$this->configured) return;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function update_time_delta_interval
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Wontfix
private function update_time_delta_interval()
{
try {
if (time() - $this->time_delta_last_update >= 60 * Constants::SYNC_TIME_UPDATE_INTERVAL) {
// Get time information from Coralogix servers
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"