Showing 503 of 503 total issues
Function controller
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', '$timeout', function ($scope, $timeout) {
$scope.init = function () {
if ($scope.truevalue === undefined || $scope.truevalue === "") {
$scope.truevalue = 1;
Function link
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element, attrs) {
element.bind("focus", function () {
$rootScope.lastElement = element[0];
var offCallFn = $rootScope.$on('insertPasteListener', function (e, val) {
var domElement = $rootScope.lastElement;
Function submitCreate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.submitCreate = function(close, redirect) {
$http.post($scope.config.apiEndpoint, angular.toJson($scope.data.create, true)).then(function(response) {
AdminToastService.success(i18n['js_ngrest_rm_success']);
$scope.loadList().then(function() {
$scope.applySaveCallback();
Method registerComponents
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function registerComponents()
{
return [
'adminLanguage' => [
'class' => AdminLanguage::class,
Function prepareDataProvider
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function prepareDataProvider()
{
$requestParams = Yii::$app->getRequest()->getBodyParams();
if (empty($requestParams)) {
$requestParams = Yii::$app->getRequest()->getQueryParams();
- 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 i18nAttributeFallbackValue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function i18nAttributeFallbackValue($attributeName, $preferredLanguage = null)
{
$value = $this->{$attributeName};
if (empty($value) && $this->isI18n($attributeName)) {
- 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 actionFileReplace
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function actionFileReplace()
{
$fileId = Yii::$app->request->post('fileId', false);
$raw = $_FILES['file'] ?? false;
/** @var $file \luya\admin\file\Item */
- 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 decode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function decode($value, $onEmptyValue = '')
{
$languages = Yii::$app->adminLanguage->getLanguages();
// if its not already unserialized, decode it
- 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 ensureClassName
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function ensureClassName($className)
{
$className = strtolower($className);
foreach ($this->getUseClasses() as $name) {
if (StringHelper::contains(' as ', strtolower($name))) {
- 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 actionCleanup
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function actionCleanup()
{
$tagIds = Tag::find()->select(['id'])->column();
$batch = TagRelation::find()->batch();
- 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 internalGenerateResponseArrayFromModel
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function internalGenerateResponseArrayFromModel($modelClassName, $isArray = false)
{
$object = $this->createObjectFromClassName($modelClassName);
$schema = false;
- 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 validateAttribute
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function validateAttribute($model, $attribute)
{
// if skip if unchanged is enabled and active record and the attribute has not changed, skip this validation rule.
if ($this->skipIfUnchanged && $model instanceof BaseActiveRecord) {
if (!$model->isAttributeChanged($attribute)) {
- 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 controller
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', 'ServiceImagesData', function ($scope, ServiceImagesData) {
$scope.imageSrc = null;
$scope.$watch('imageId', function (n, o) {
if (n != o) {
Function pasteUpload
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.pasteUpload = function (e) {
for (var i = 0; i < e.originalEvent.clipboardData.items.length; i++) {
var item = e.originalEvent.clipboardData.items[i];
if (item.kind == 'file') {
LuyaLoading.start(i18n['js_dir_upload_wait']);
Function controller
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', '$element', '$timeout', function ($scope, $element, $timeout) {
if ($scope.model === undefined) {
$scope.model = [];
}
Method ngRestActiveWindows
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ngRestActiveWindows()
{
return [
[
'class' => DetailViewActiveWindow::class,
Method extractFilesDataFromFilesArray
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function extractFilesDataFromFilesArray(array $file)
{
if (!isset($file['tmp_name'])) {
return [];
}
Method callbackPie
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function callbackPie()
{
return [
'tooltip' => ['trigger' => 'item', 'formatter' => '{c} {b}'],
'legend' => ['orient' => 'vertical', 'x' => 'left', 'data' => [Module::t('aw_userhistorysummary_contribcount_inserts'), Module::t('aw_userhistorysummary_contribcount_updates')]],
Function controller
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', '$http', function ($scope, $http) {
$scope.tags = [];
$http.get('admin/api-admin-common/tags').then(function (response) {
angular.forEach(response.data, function (value) {
Method startImages
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function startImages()
{
$imageCount = 0;
// sync images
foreach ((new \luya\admin\image\Query())->all() as $image) {