Showing 331 of 503 total issues
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) {
Method actionCleanup
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionCleanup()
{
$tagIds = Tag::find()->select(['id'])->column();
$batch = TagRelation::find()->batch();
Method createSchema
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createSchema($attributeName)
{
$property = $this->phpDocParser->getProperty($attributeName);
$type = $property->getType();
Consider simplifying this complex logical expression. Open
if (date.getFullYear() &&
!isNaN(date.getDay()) &&
!isNaN(date.getMonth()) &&
$scope.isSelectableDay(date.getMonth(), date.getFullYear(), date.getDay()) &&
$scope.isSelectableDate(date.getMonth(), date.getFullYear(), date.getDay()) &&
Function actionServices
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function actionServices()
{
$settings = [];
$apiEndpoint = $this->model->ngRestApiEndpoint();
$userSortSettings = Yii::$app->adminuser->identity->setting->get('ngrestorder.admin/'.$apiEndpoint, 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 onListFind
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function onListFind($event)
{
// async list ignores the onListFind event
if ($this->asyncList) {
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 optionsArrayInput
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function optionsArrayInput($data)
{
// seems to be a two way data binind, thefore direct return the string and do not transform.
if (is_scalar($data)) {
return $data;
- 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 setBuildConfig
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function setBuildConfig(array $config)
{
$this->_buildConfig = $config;
foreach ($config['tables'] as $tableName => $tableConfig) {
- 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 generateLabels
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function generateLabels($table)
{
$labels = [];
foreach ($table->columns as $column) {
if ($this->generateLabelsFromComments && !empty($column->comment)) {
- 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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
controller: ['$scope', '$http', '$filter', 'ServiceFiltersData', 'ServiceImagesData', 'AdminToastService', 'ServiceFilesData', function ($scope, $http, $filter, ServiceFiltersData, ServiceImagesData, AdminToastService, ServiceFilesData) {
Method renderElementPlugins
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function renderElementPlugins($configContext, $typeConfig, $uniqueId, $attribute, $ngRestModel, $label, $elmni18n)
Method schedule
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function schedule($ngModel, $label, $primaryKeyValue, array $values, $modelClass, $attributeName, array $options = [])
Function datepickerDirective
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
, datepickerDirective = function datepickerDirective($window, $compile, $locale, $filter, $interpolate, $timeout) {
Function where
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function where(array $args)
{
foreach ($args as $key => $value) {
if (in_array($value, $this->_whereOperators, true)) {
if (count($args) !== 3) {
- 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 getConfigButtonCondition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getConfigButtonCondition($scope)
{
$buttonConditionConfigOption = $this->config->getOption('buttonCondition');
// return empty string of no condition is defined
- 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"