stk2k/stream-logger

View on GitHub

Showing 16 of 16 total issues

Similar blocks of code found in 4 locations. Consider refactoring.
Open

<?php
declare(strict_types=1);

namespace Stk2k\StreamLogger;

Severity: Major
Found in src/SimpleMemoryLogger.php and 3 other locations - About 2 hrs to fix
src/SimpleOutputLogger.php on lines 1..36
src/SimpleStdErrLogger.php on lines 1..36
src/SimpleStdOutLogger.php on lines 1..36

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 134.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

<?php
declare(strict_types=1);

namespace Stk2k\StreamLogger;

Severity: Major
Found in src/SimpleOutputLogger.php and 3 other locations - About 2 hrs to fix
src/SimpleMemoryLogger.php on lines 1..36
src/SimpleStdErrLogger.php on lines 1..36
src/SimpleStdOutLogger.php on lines 1..36

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 134.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

<?php
declare(strict_types=1);

namespace Stk2k\StreamLogger;

Severity: Major
Found in src/SimpleStdErrLogger.php and 3 other locations - About 2 hrs to fix
src/SimpleMemoryLogger.php on lines 1..36
src/SimpleOutputLogger.php on lines 1..36
src/SimpleStdOutLogger.php on lines 1..36

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 134.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

<?php
declare(strict_types=1);

namespace Stk2k\StreamLogger;

Severity: Major
Found in src/SimpleStdOutLogger.php and 3 other locations - About 2 hrs to fix
src/SimpleMemoryLogger.php on lines 1..36
src/SimpleOutputLogger.php on lines 1..36
src/SimpleStdErrLogger.php on lines 1..36

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 134.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method format has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function format($level, $message, array $context, string $file, int $line, DateTime $time): string
    {
        return $this->processor->process($this->format, function($keyword) use($level, $message, $context, $file, $line, $time){
            switch($keyword){
                case 'LEVEL':
Severity: Minor
Found in src/Formatter/DefaultFormatter.php - About 1 hr to fix

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    <?php
    declare(strict_types=1);
    
    namespace Stk2k\StreamLogger;
    
    
    Severity: Major
    Found in src/BufferedOutputLogger.php and 4 other locations - About 1 hr to fix
    src/BufferedMemoryLogger.php on lines 1..35
    src/BufferedStdErrLogger.php on lines 1..35
    src/BufferedStdOutLogger.php on lines 1..35
    src/BufferedTempLogger.php on lines 1..35

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 105.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    <?php
    declare(strict_types=1);
    
    namespace Stk2k\StreamLogger;
    
    
    Severity: Major
    Found in src/BufferedTempLogger.php and 4 other locations - About 1 hr to fix
    src/BufferedMemoryLogger.php on lines 1..35
    src/BufferedOutputLogger.php on lines 1..35
    src/BufferedStdErrLogger.php on lines 1..35
    src/BufferedStdOutLogger.php on lines 1..35

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 105.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    <?php
    declare(strict_types=1);
    
    namespace Stk2k\StreamLogger;
    
    
    Severity: Major
    Found in src/BufferedStdErrLogger.php and 4 other locations - About 1 hr to fix
    src/BufferedMemoryLogger.php on lines 1..35
    src/BufferedOutputLogger.php on lines 1..35
    src/BufferedStdOutLogger.php on lines 1..35
    src/BufferedTempLogger.php on lines 1..35

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 105.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    <?php
    declare(strict_types=1);
    
    namespace Stk2k\StreamLogger;
    
    
    Severity: Major
    Found in src/BufferedMemoryLogger.php and 4 other locations - About 1 hr to fix
    src/BufferedOutputLogger.php on lines 1..35
    src/BufferedStdErrLogger.php on lines 1..35
    src/BufferedStdOutLogger.php on lines 1..35
    src/BufferedTempLogger.php on lines 1..35

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 105.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    <?php
    declare(strict_types=1);
    
    namespace Stk2k\StreamLogger;
    
    
    Severity: Major
    Found in src/BufferedStdOutLogger.php and 4 other locations - About 1 hr to fix
    src/BufferedMemoryLogger.php on lines 1..35
    src/BufferedOutputLogger.php on lines 1..35
    src/BufferedStdErrLogger.php on lines 1..35
    src/BufferedTempLogger.php on lines 1..35

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 105.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function __construct($level, string $message, array $context, string $file, int $line, DateTime $time)
    Severity: Minor
    Found in src/LogMessage.php - About 45 mins to fix

      Method addMessage has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private function addMessage($level, string $message, array $context, string $file, int $line, DateTime $time)
      Severity: Minor
      Found in src/BufferedStreamTrait.php - About 45 mins to fix

        Method writeln has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function writeln($level, $message, $context, $file, $line, DateTime $time)
        Severity: Minor
        Found in src/Stream.php - About 45 mins to fix

          Method format has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function format($level, $message, array $context, string $file, int $line, DateTime $time): string
          Severity: Minor
          Found in src/Formatter/DefaultFormatter.php - About 45 mins to fix

            Method format has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function format($level, $message, array $context, string $file, int $line, DateTime $time) : string;
            Severity: Minor
            Found in src/LogFormatterInterface.php - About 45 mins to fix

              Method format has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function format($level, $message, array $context, string $file, int $line): string
              Severity: Minor
              Found in demo/example3.php - About 35 mins to fix
                Severity
                Category
                Status
                Source
                Language