CornyPhoenix/tex-tools

View on GitHub

Showing 6 of 6 total issues

Job has 31 functions (exceeds 20 allowed). Consider refactoring.
Open

class Job
{

    /**
     * Traits for more functionality.
Severity: Minor
Found in src/Jobs/Job.php - About 3 hrs to fix

    Function parseTree has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function parseTree()
        {
            $text = $this->content;
    
            $nesting = -1;
    Severity: Minor
    Found in src/Log/LogTree.php - About 1 hr to fix

    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 parseTree has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function parseTree()
        {
            $text = $this->content;
    
            $nesting = -1;
    Severity: Minor
    Found in src/Log/LogTree.php - About 1 hr to fix

      Function setText has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function setText($text)
          {
              // Make lines array out of text.
              $wrappedLines = explode("\n", preg_replace("/(\\r\\n)|\\r/", "\n", $text));
      
      
      Severity: Minor
      Found in src/Log/LogText.php - About 45 mins to fix

      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 __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function __construct($message, $level, $filename, $line, $content = '')
      Severity: Minor
      Found in src/Log/Message.php - About 35 mins to fix

        Function parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function parse()
            {
                $messages = [];
                foreach ($this->logTree as $element) {
                    if ($element->isEmpty()) {
        Severity: Minor
        Found in src/Log/LogParser.php - About 25 mins to fix

        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

        Severity
        Category
        Status
        Source
        Language