Skip to content

Instantly share code, notes, and snippets.

@nikic
Created April 24, 2019 16:13
Show Gist options
  • Save nikic/b6214f87b0e4a7c6fe26919ac849194f to your computer and use it in GitHub Desktop.
Save nikic/b6214f87b0e4a7c6fe26919ac849194f to your computer and use it in GitHub Desktop.
(possibly okay) /home/nikic/package-analysis/sources/symfony/routing/Matcher/Dumper/CompiledUrlMatcherDumper.php:225
$compiledRoutes[$url][] = $this->compileRoute($route, $name, !$route->compile()->getHostVariables() ? $route->getHost() : $route->compile()->getHostRegex() ?: null, $hasTrailingSlash, false, $conditions);
(duplicate) /home/nikic/package-analysis/sources/symfony/symfony/src/Symfony/Component/Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php:225
(BUG!) /home/nikic/package-analysis/sources/symfony/symfony/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php:113
$messageLocation = isset($tag['handles']) ? 'declared in your tag attribute "handles"' : $r->implementsInterface(MessageSubscriberInterface::class) ? sprintf('returned by method "%s::getHandledMessages()"', $r->getName()) : sprintf('used as argument type in method "%s::%s()"', $r->getName(), $method);
(BUG!) /home/nikic/package-analysis/sources/symfony/symfony/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php:126
$messageLocation = isset($tag['handles']) ? 'declared in your tag attribute "handles"' : $r->implementsInterface(MessageSubscriberInterface::class) ? sprintf('returned by method "%s::getHandledMessages()"', $r->getName()) : sprintf('used as argument type in method "%s::%s()"', $r->getName(), $method);
(duplicate) /home/nikic/package-analysis/sources/symfony/messenger/DependencyInjection/MessengerPass.php:113
(duplicate) /home/nikic/package-analysis/sources/symfony/messenger/DependencyInjection/MessengerPass.php:126
(possibly okay) /home/nikic/package-analysis/sources/ekino/newrelic-bundle/NewRelic/Config.php:32
$this->name = !empty($name) ? $name : \ini_get('newrelic.appname') ?: '';
(possibly okay) /home/nikic/package-analysis/sources/ekino/newrelic-bundle/NewRelic/Config.php:34
$this->licenseKey = !empty($licenseKey) ? $licenseKey : \ini_get('newrelic.license') ?: '';
(BUG!) /home/nikic/package-analysis/sources/kartik-v/yii2-grid/src/ColumnTrait.php:274
$curr = is_array($this->format) && isset($this->format[1]) ? $this->format[1] :
isset($formatter->currencyCode) ? $formatter->currencyCode . ' ' : '';
(BUG!) /home/nikic/package-analysis/sources/zendframework/zendframework1/library/Zend/Service/Console/Command.php:223
$handlerDescription = isset($handlerDescriptions[$hi]) ? $handlerDescriptions[$hi] : isset($handlerDescriptions[0]) ? $handlerDescriptions[0] : '';
(BUG!) /home/nikic/package-analysis/sources/hoa/compiler/Bin/Pp.php:232
30 < $token['length']
? mb_substr($token['value'], 0, 29) . '…'
: 'EOF' === $token['token']
? str_repeat(' ', 30)
: $token['value'] .
str_repeat(' ', 30 - $token['length']),
(BUG!) /home/nikic/package-analysis/sources/jms/serializer/src/SerializationContext.php:152
return $this->initialType
? $this->initialType
: $this->hasAttribute('initial_type') ? $this->getAttribute('initial_type') : null;
(BUG!) /home/nikic/package-analysis/sources/psy/psysh/src/Formatter/SignatureFormatter.php:290
$value = \is_array($value) ? 'array()' : \is_null($value) ? 'null' : \var_export($value, true);
(BUG!) /home/nikic/package-analysis/sources/nesbot/carbon/src/Carbon/Lang/ga.php:69
return $number.($number === 1 ? 'd' : $number % 10 === 2 ? 'na' : 'mh');
(BUG!) /home/nikic/package-analysis/sources/respect/validation/library/Rules/Cnh.php:59
$check = $dv2 < 0 ? $dv2 + 11 : $dv2 > 9 ? 0 : $dv2;
@PHPGangsta
Copy link

Great work! But instead of analyzing the top 1000 repos, which are rather high-quality I would guess, analyzing random repositories with the same amount of files/lines would reveal many more cases?
If your top 1000 repos have 1000000 PHP files, it would be nice to find random 1000000 PHP files on github, and analyze them. Maybe repos with at least 10 forks or 10 stars or simliar?

@thg2k
Copy link

thg2k commented May 7, 2019

Link to the script generating this: @nikic/anaylze_ternary.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment