private function renamingDetection(array $logItem, array $currentCommit, array &$fileHistory, GitRepository $git)
    {
        if ($logItem['criteria'] !== 'R') {
            return;
        }

        if ((int) $logItem['index'] >= 75) {
            $fileHistory[\md5($logItem['from'])] = $logItem['from'];

            return;
        }

        $fromFileContent = $this->getFileContent($currentCommit['parent'] . ':' . $logItem['from'], $git);
        $toFileContent   = $this->getFileContent($logItem['commit'] . ':' . $logItem['to'], $git);
        $tempFrom        =
            $this->createTempFile($logItem['commit'] . ':' . $logItem['from'], $fromFileContent);
        $tempTo          = $this->createTempFile($logItem['commit'] . ':' . $logItem['to'], $toFileContent);

        $detector = new Detector(new DefaultStrategy());
        $result   = $detector->copyPasteDetection([$tempFrom, $tempTo], 2, 7);

        if (!$result->count()) {
            return;
        }

        $fileHistory[\md5($logItem['from'])] = $logItem['from'];
    }
private function renamingDetection(array $logItem, array $currentCommit, array &$fileHistory, GitRepository $git)
    {
        if ($logItem['criteria'] !== 'R') {
            return;
        }

        if ((int) $logItem['index'] >= 75) {
            $fileHistory[\md5($logItem['from'])] = $logItem['from'];

            return;
        }

        $fromFileContent = $this->getFileContent($currentCommit['parent'] . ':' . $logItem['from'], $git);
        $toFileContent   = $this->getFileContent($logItem['commit'] . ':' . $logItem['to'], $git);
        $tempFrom        =
            $this->createTempFile($logItem['commit'] . ':' . $logItem['from'], $fromFileContent);
        $tempTo          = $this->createTempFile($logItem['commit'] . ':' . $logItem['to'], $toFileContent);

        $detector = new Detector(new DefaultStrategy());
        $result   = $detector->copyPasteDetection([$tempFrom, $tempTo], 2, 7);

        if (!$result->count()) {
            return;
        }

        $fileHistory[\md5($logItem['from'])] = $logItem['from'];
    }
private function renamingDetection ( array $ logItem , array $ currentCommit , array & $ fileHistory , GitRepository $ git ) { if ( $ logItem [ 'criteria' ] !== 'R' ) { return ; } if ( ( int ) $ logItem [ 'index' ] >= 75 ) { $ fileHistory [ \ md5 ( $ logItem [ 'from' ] ) ] = $ logItem [ 'from' ] ; return ; } $ fromFileContent = $ this -> getFileContent ( $ currentCommit [ 'parent' ] . ':' . $ logItem [ 'from' ] , $ git ) ; $ toFileContent = $ this -> getFileContent ( $ logItem [ 'commit' ] . ':' . $ logItem [ 'to' ] , $ git ) ; $ tempFrom = $ this -> createTempFile ( $ logItem [ 'commit' ] . ':' . $ logItem [ 'from' ] , $ fromFileContent ) ; $ tempTo = $ this -> createTempFile ( $ logItem [ 'commit' ] . ':' . $ logItem [ 'to' ] , $ toFileContent ) ; $ detector = new Detector ( new DefaultStrategy ( ) ) ; $ result = $ detector -> copyPasteDetection ( [ $ tempFrom , $ tempTo ] , 2 , 7 ) ; if ( ! $ result -> count ( ) ) { return ; } $ fileHistory [ \ md5 ( $ logItem [ 'from' ] ) ] = $ logItem [ 'from' ] ; }
Detected file follow by the renaming criteria.

@param array         $logItem       The git log item.
@param array         $currentCommit The current commit information.
@param array         $fileHistory   The file history.
@param GitRepository $git           The git repository.

@return void
Detected file follow by the renaming criteria .