Showing 33 of 50 total issues
Method init
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function init(LoaderInterface $loader, $lang = null, $timezone = null)
{
$this->setLoader($loader);
if (is_null($lang)) {
$lang = substr(Locale::getDefault(), 0, 2);
Function _getOrigin
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function _getOrigin()
{
$ch = curl_init(self::IANA_LANGUAGE_SUBTAG_REGISTRY);
if ($ch) {
$tmpfname = tempnam("/tmp", "ianadb.txt");
- Read upRead up
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
Function findLanguageDBFile
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function findLanguageDBFile($db_filename = null, $db_directory = null)
{
if (empty($db_filename)) {
$db_filename = $this->buildLanguageDBFileName();
}
- Read upRead up
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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Twig_Node_Expression_Array $choices,
Twig_Node_Expression_Constant $counter,
Twig_Node_Expression_Array $params,
Twig_Node_Expression_Constant $lang,
$lineno, $tag = null
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Twig_NodeInterface $body,
Twig_Node_Expression_Array $params,
Twig_Node_Expression_Constant $lang,
$lineno, $tag = null
Function parseStringMetadata
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function parseStringMetadata($str)
{
$info = array();
if (0!==preg_match('~^\[([^\]]+)\]~i', $str, $matches)) {
$str = str_replace($matches[0], '', $str);
- Read upRead up
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
Function loadClass
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function loadClass($className)
{
if ($filePath = $this->resolveFileName($className)) {
if ($this->getFailureFlag() & self::FAIL_GRACEFULLY) {
if ($this->classFileExists($filePath)) {
- Read upRead up
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
Function init
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function init(LoaderInterface $loader, $lang = null, $timezone = null)
{
$this->setLoader($loader);
if (is_null($lang)) {
$lang = substr(Locale::getDefault(), 0, 2);
- Read upRead up
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
Function translate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function translate($index, array $args = null, $lang = null)
{
$_this = self::getInstance();
if (!is_null($lang)) {
$original_lang = $_this->getLanguage();
- Read upRead up
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
Avoid too many return
statements within this method. Open
return $this;
Function getGitHubCommits
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getGitHubCommits( github, callback ) {
$.ajax(github+'commits', {
method: 'GET',
crossDomain: true,
data: { page: 1, per_page: 5 },
- Read upRead up
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
Function getParsedOption
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getParsedOption($name, $lang = null, $default = null)
{
$val = $this->getOption($name, $default);
if (false!==strpos($val, '%s')) {
if (is_null($lang)) {
- Read upRead up
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
Function getGitHubBugs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getGitHubBugs( github, callback ) {
$.ajax(github+'issues', {
method: 'GET',
crossDomain: true,
data: { page: 1, per_page: 5 },
- Read upRead up
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"