Build/update-changelog.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using count() function in for loops.
Open

        for ($i = 0; $i < count($title); $i++) {
            $detailedTitle = $this->replaceCodeSections($title[$i]);
            $pullRequest = null;

            $detailedBody = preg_replace('/\n/', "\n> ", $body[$i]);
Severity: Minor
Found in Build/update-changelog.php by phpmd

CountInLoopExpression

Since: 2.7.0

Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

Example

class Foo {

  public function bar()
  {
    $array = array();

    for ($i = 0; count($array); $i++) {
      // ...
    }
  }
}

Source https://phpmd.org/rules/design.html#countinloopexpression

Each class must be in a namespace of at least one level (a top-level vendor name)
Wontfix

class UpdateChangelog
Severity: Minor
Found in Build/update-changelog.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 24 and the first side effect is on line 260.
Wontfix

<?php
Severity: Minor
Found in Build/update-changelog.php by phpcodesniffer

There are no issues that match your filters.

Category
Status