Saibamen/Generate-Sort-Numbers

View on GitHub

Showing 6 of 6 total issues

Function generateAndSaveRandomNumbers has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

public static function generateAndSaveRandomNumbers($min, $max, $decimalPlaces, $maxFileSize, $filename, $fileExtension = '.dat', $delimiter = ' ')
{
$range = $max - $min;
 
$minMaxNumberSize = self::getMinMaxNumberSize($min, $max, $decimalPlaces);
Severity: Minor
Found in Includes/Generate.php - About 2 hrs to fix

Method generateAndSaveRandomNumbers has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public static function generateAndSaveRandomNumbers($min, $max, $decimalPlaces, $maxFileSize, $filename, $fileExtension = '.dat', $delimiter = ' ')
{
$range = $max - $min;
 
$minMaxNumberSize = self::getMinMaxNumberSize($min, $max, $decimalPlaces);
Severity: Major
Found in Includes/Generate.php - About 2 hrs to fix

    Method getBytesFromString has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    public static function getBytesFromString($input, $notation = 1024)
    {
    $error = true;
    $bytes = 0;
     
     
    Severity: Minor
    Found in Includes/Input.php - About 1 hr to fix

      Method generateAndSaveRandomNumbers has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      public static function generateAndSaveRandomNumbers($min, $max, $decimalPlaces, $maxFileSize, $filename, $fileExtension = '.dat', $delimiter = ' ')
      Severity: Major
      Found in Includes/Generate.php - About 50 mins to fix

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

        public static function getBytesFromString($input, $notation = 1024)
        {
        $error = true;
        $bytes = 0;
         
         
        Severity: Minor
        Found in Includes/Input.php - About 45 mins to fix

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

        public static function getFileSize($message, $default = '1MB')
        {
        echo $message.' [Default: '.$default.']: ';
         
        do {
        Severity: Minor
        Found in Includes/Input.php - About 45 mins to fix
        Severity
        Category
        Status
        Source
        Language