Showing 1,520 of 1,520 total issues

Function processInit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function processInit(CHttpRequest $request, Order $order)
    {
        if (!$order) {
            $message = Yii::t('TinkoffPayModule.tpay', 'The order doesn\'t exist.');
            Yii::log($message, CLogger::LEVEL_ERROR);

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 uploadAttributesFiles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function uploadAttributesFiles($model)
    {
        if (!empty($_FILES['Attribute']['name'])) {
            foreach ($_FILES['Attribute']['name'] as $key => $file) {
                $value = AttributeValue::model()->find('product_id = :product AND attribute_id = :attribute', [
Severity: Minor
Found in protected/modules/store/controllers/ProductBackendController.php - About 25 mins to fix

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 addRule has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function addRule($sourceState, $input, $targetState, $inputAction = null)
    {
        if (!isset($this->_states[$sourceState])) {
            require_once 'Zend/Search/Exception.php';
            throw new Zend_Search_Exception('Undefined source state (' . $sourceState . ').');
Severity: Minor
Found in protected/modules/zendsearch/vendors/Zend/Search/Lucene/FSM.php - About 25 mins to fix

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 arrayFromArgs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function arrayFromArgs($items)
    {
        $array = [];

        if (!$items) {
Severity: Minor
Found in protected/modules/store/components/behaviors/DCategoryTreeBehavior.php - About 25 mins to fix

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 add has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function add($data, $referrer = null)
    {
        if (!$data) {
            return false;
        }
Severity: Minor
Found in protected/modules/callback/components/CallbackManager.php - About 25 mins to fix

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 getEntityItemList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getEntityItemList($moduleName, $entityName)
    {
        $data = [];

        if ($moduleName !== null && $entityName !== null) {
Severity: Minor
Found in protected/modules/menu/components/MenuComponent.php - About 25 mins to fix

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 beforeSave has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function beforeSave()
    {
        if (!$this->getIsNewRecord() && $this->_oldAccess_level === self::ACCESS_LEVEL_ADMIN) {
            // Запрещаем действия, при которых администратор
            // может быть заблокирован или сайт останется без
Severity: Minor
Found in protected/modules/user/models/User.php - About 25 mins to fix

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 renameFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function renameFile($from, $to)
    {
        global $php_errormsg;

        if (isset($this->_fileHandlers[$from])) {

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 activatePassword has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function activatePassword($token, $password = null, $notify = true)
    {
        $tokenModel = $this->tokenStorage->get($token, UserToken::TYPE_CHANGE_PASSWORD);

        if (null === $tokenModel) {
Severity: Minor
Found in protected/modules/user/components/UserManager.php - About 25 mins to fix

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 changeUserEmail has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function changeUserEmail(User $user, $email, $confirm = true)
    {
        if ($user->email == $email) {
            return true;
        }
Severity: Minor
Found in protected/modules/user/components/UserManager.php - About 25 mins to fix

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 actionDelete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function actionDelete($id)
    {
        if (Yii::app()->getRequest()->getIsPostRequest()) {

            $transaction = Yii::app()->getDb()->beginTransaction();
Severity: Minor
Found in protected/modules/store/controllers/AttributeBackendController.php - About 25 mins to fix

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 delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete($id)
    {
        $this->_deletedDirty = true;

        if (extension_loaded('bitset')) {

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 search has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function search()
    {
        $criteria = new CDbCriteria();

        $criteria->with = ['user'];
Severity: Minor
Found in protected/modules/user/models/UserToken.php - About 25 mins to fix

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 getModuleList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getModuleList()
    {
        $data = [];

        if ($this->modules) {
Severity: Minor
Found in protected/modules/menu/components/MenuComponent.php - About 25 mins to fix

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 norm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function norm($id, $fieldName)
    {
        if ($id >= $this->_docCount) {
            return null;
        }
Severity: Minor
Found in protected/modules/zendsearch/vendors/Zend/Search/Lucene.php - About 25 mins to fix

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 safeUp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function safeUp()
    {
        $this->createTable('{{store_order_coupon}}', [
                "id" => "pk",
                'order_id'    => 'integer not null',

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 delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete($id)
    {
        if ($id instanceof Zend_Search_Lucene_Search_QueryHit) {
            /* @var $id Zend_Search_Lucene_Search_QueryHit */
            $id = $id->id;
Severity: Minor
Found in protected/modules/zendsearch/vendors/Zend/Search/Lucene.php - About 25 mins to fix

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 actionCreate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function actionCreate()
    {
        $model = new Coupon();
        $attributes = Yii::app()->getRequest()->getPost('Coupon');

Severity: Minor
Found in protected/modules/coupon/controllers/CouponBackendController.php - About 25 mins to fix

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 actionUpdate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function actionUpdate($id)
    {
        $model = $this->loadModel($id);
        $attributes = Yii::app()->getRequest()->getPost('Coupon');

Severity: Minor
Found in protected/modules/coupon/controllers/CouponBackendController.php - About 25 mins to fix

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 highlightExtended has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function highlightExtended($words, $callback, $params = [])
    {
        /** Zend_Search_Lucene_Analysis_Analyzer */
        require_once 'Zend/Search/Lucene/Analysis/Analyzer.php';

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

Severity
Category
Status
Source
Language