Showing 25 of 53 total issues
Method run
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
$proxyManager = Yii::createObject(ProxyManager::class);
$accountBuilder = Yii::createObject([
'class' => AccountBuilder::class,
- Create a ticketCreate a ticket
Function actionUpdateName
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function actionUpdateName($names)
{
$rows = StringHelper::explode($names, ';', true, true);
foreach ($rows as $row) {
$username = StringHelper::explode($row);
- Read upRead up
- Create a ticketCreate a ticket
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 actionCreateAccount
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function actionCreateAccount()
{
$form = new MonitoringForm();
$form->setScenario(TrackerType::ACCOUNT);
- Read upRead up
- Create a ticketCreate a ticket
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 run
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
$proxyManager = Yii::createObject(ProxyManager::class);
$tagBuilder = Yii::createObject([
'class' => TagBuilder::class,
- Create a ticketCreate a ticket
Method reserve
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function reserve(bool $ignoreRest = false): Proxy
{
$uid = $this->generateUid();
$condition = [
'and',
- Create a ticketCreate a ticket
Method actionTags
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionTags()
{
$searchModel = new TagSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$dataProvider->query->andWhere(['tag.monitoring' => 1]);
- Create a ticketCreate a ticket
Function actionDictionaries
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function actionDictionaries()
{
$dictionaries = [
AccountInvalidationType::class,
TagInvalidationType::class,
- Read upRead up
- Create a ticketCreate a ticket
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 actionAccounts
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionAccounts()
{
$searchModel = new AccountSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$dataProvider->query->andWhere(['account.monitoring' => 1]);
- Create a ticketCreate a ticket
Method initData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function initData($olderDate, $newerDate = null)
{
$olderDate = (new Carbon($olderDate))->startOfDay()->toDateTimeString();
$newerDate = (new Carbon($newerDate))->endOfDay()->toDateTimeString();
- Create a ticketCreate a ticket
Function run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
$proxyManager = Yii::createObject(ProxyManager::class);
$accountBuilder = Yii::createObject([
'class' => AccountBuilder::class,
- Read upRead up
- Create a ticketCreate a ticket
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 fetchAccountData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function fetchAccountData(AccountScraper $scraper): Account
{
$idents = array_filter([
$this->account->username,
]);
- Read upRead up
- Create a ticketCreate a ticket
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 init
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init()
{
if (empty($this->statsAttributes)) {
$this->statsAttributes = [
'followed_by',
- Create a ticketCreate a ticket
Method run
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
if ($this->model->monitoring) {
return AjaxButton::widget([
'confirm' => true,
- Create a ticketCreate a ticket
Method prepareModels
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function prepareModels()
{
$models = [];
$dbFrom = $this->from->copy();
- Create a ticketCreate a ticket
Method init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init()
{
parent::init();
$this->throwExceptionIfAccountIsNotSet();
$this->throwExceptionIfFromToAreNotSet();
- Create a ticketCreate a ticket
Method registerClientScript
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function registerClientScript()
{
$options = ArrayHelper::merge([
'url' => Url::to($this->url),
'method' => 'post',
- Create a ticketCreate a ticket
Method run
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
$config = [
'id' => $this->id,
'type' => $this->type,
- Create a ticketCreate a ticket
Method actionCreateAccount
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionCreateAccount()
{
$form = new MonitoringForm();
$form->setScenario(TrackerType::ACCOUNT);
- Create a ticketCreate a ticket
Function setStats
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function setStats(Account $account, array $posts, bool $createHistory = true)
{
$this->account->touch('stats_updated_at');
if ($this->account->media === null || $this->statsNeedUpdate($account, $posts)) {
$postsStats = $this->postsStats($account, $posts);
- Read upRead up
- Create a ticketCreate a ticket
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 actionCreateTag
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function actionCreateTag()
{
$form = new MonitoringForm();
$form->setScenario(TrackerType::TAG);
- Read upRead up
- Create a ticketCreate a ticket
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"