Showing 331 of 503 total issues
Method callbackUpload
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function callbackUpload()
{
$config = new Config();
$config->setTempDir($this->getTempFolder());
$file = new File($config);
Method actionAsync
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionAsync()
{
if (($lockout = $this->sessionBruteForceLock(0))) {
return $this->sendArray(false, [Module::t('login_async_submission_limit_reached', ['time' => Yii::$app->formatter->asRelativeTime($lockout)])]);
}
Function addFile
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function addFile($fileSource, $fileName, $folderId = 0, $isHidden = false)
{
// ensure the file upload
$fileData = $this->ensureFileUpload($fileSource, $fileName);
// generate md5 hash from file source
- 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 formatExportValues
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function formatExportValues(ActiveQuery $query, array $formatter)
{
Yii::$app->formatter->nullDisplay = '';
$data = [];
$rowId = 0;
- 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 ngRestConfig
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function ngRestConfig($config)
{
foreach ($this->ngRestScopes() as $arrayConfig) {
if (!isset($arrayConfig[0]) && !isset($arrayConfig[1])) {
throw new InvalidConfigException("Invalid ngRestScope definition. Definition must contain an array with two elements: `['create', []]`");
- 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 extractFilesDataFromMultipleFiles
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function extractFilesDataFromMultipleFiles(array $files)
{
$data = [];
$i = 0;
foreach ($files as $type => $field) {
- 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 getActiveLanguage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getActiveLanguage()
{
if ($this->_activeLanguage === null) {
if ($this->activeShortCodeCallable && is_callable($this->activeShortCodeCallable)) {
$langShortCode = call_user_func($this->activeShortCodeCallable, $this);
- 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 extractFilesDataFromFilesArray
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function extractFilesDataFromFilesArray(array $file)
{
if (!isset($file['tmp_name'])) {
return [];
}
- 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 actionFixTableNames
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function actionFixTableNames()
{
$batch = TagRelation::find()->batch();
$i = 0;
$fixed = 0;
- 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 validatePassword
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function validatePassword($attribute)
{
if (!$this->hasErrors()) {
$user = $this->getUser();
- 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 run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
$this->refresh('thumbnail', [
'name' => 'Thumbnail',
'imagine_name' => 'thumbnail',
- 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 getParameters
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getParameters(): array
{
$params = [];
if ($this->getReflection() instanceof ReflectionMethod) {
foreach ($this->getReflection()->getParameters() as $arg) {
- 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 template
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
template: function () {
return '' +
'<div class="form-group form-side-by-side" ng-class="{\'input--hide-label\': i18n}">' +
'<div class="form-side form-side-label">' +
'<label>{{label}}</label>' +
Method getAngularControllerConfig
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getAngularControllerConfig()
{
return [
'apiListQueryString' => $this->context->apiQueryString('list'),
'apiUpdateQueryString' => $this->context->apiQueryString('update'),
Method actionRelationCall
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionRelationCall($arrayIndex, $id, $modelClass, $query = null)
{
$modelClass = base64_decode($modelClass);
if (!class_exists($modelClass)) {
Method onListFind
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function onListFind($event)
{
// async list ignores the onListFind event
if ($this->asyncList) {
return;
Function template
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
template: function () {
return '' +
'<div class="form-group form-side-by-side zaa-datetime" ng-class="{\'input--hide-label\': i18n, \'input--with-time\': model!=null && date!=null}">' +
'<div class="form-side form-side-label">' +
'<label>{{label}}</label>' +
Method startFiles
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function startFiles()
{
$fileCount = 0;
// sync files
foreach ((new Query())->where(['is_deleted' => false])->all() as $file) {
Function success
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
success: function (response) {
$('.login-btn[type="submit"]').attr('disabled', false);
$('.login-spinner').hide();
$('.login-btn-label').show();
var refresh = response['refresh'];
Function onTyping
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
thisInput.on('keyup blur', function onTyping() {
if (thisInput[0].value &&
thisInput[0].value.length &&
thisInput[0].value.length > 0) {