YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/CurrencyUpdate/models/AbstractBank.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

The method getRates has a boolean flag argument $cron, which is a certain sign of a Single Responsibility Principle violation.
Open

    abstract public function getRates($currencies, $date, $cron = false);

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Saw unextractable annotation for comment '* @param <date> $date - date for which exchange is fetched'</date>
Open

     * @param <Date>  $date       - date for which exchange is fetched

Saw unextractable annotation for comment '* @param <array> $currencies - list of systems active currencies'</array>
Open

     * @param <Array> $currencies - list of systems active currencies

Avoid excessively long class names like Settings_CurrencyUpdate_AbstractBank_Model. Keep class name length under 40.
Open

abstract class Settings_CurrencyUpdate_AbstractBank_Model
{
    // Returns bank name

    abstract public function getName();

LongClassName

Since: 2.9

Detects when classes or interfaces are declared with excessively long names.

Example

class ATooLongClassNameThatHintsAtADesignProblem {

}

interface ATooLongInterfaceNameThatHintsAtADesignProblem {

}

Source https://phpmd.org/rules/naming.html#longclassname

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

abstract class Settings_CurrencyUpdate_AbstractBank_Model

The class Settings_CurrencyUpdate_AbstractBank_Model is not named in CamelCase.
Open

abstract class Settings_CurrencyUpdate_AbstractBank_Model
{
    // Returns bank name

    abstract public function getName();

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

Spaces must be used to indent lines; tabs are not allowed
Open

    // Returns bank name

Spaces must be used to indent lines; tabs are not allowed
Open

    abstract public function getName();

Spaces must be used to indent lines; tabs are not allowed
Open

    abstract public function getSupportedCurrencies();

Spaces must be used to indent lines; tabs are not allowed
Open

    // Returns url sources from where exchange rates are taken from

Spaces must be used to indent lines; tabs are not allowed
Open

    // Returns list of currencies supported by this bank

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    abstract public function getMainCurrencyCode();

Spaces must be used to indent lines; tabs are not allowed
Open

    abstract public function getSource();

Spaces must be used to indent lines; tabs are not allowed
Open

    // Returns banks main currency

Spaces must be used to indent lines; tabs are not allowed
Open

     * Fetch exchange rates.

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param <Date>  $date       - date for which exchange is fetched

Spaces must be used to indent lines; tabs are not allowed
Open

    abstract public function getRates($currencies, $date, $cron = false);

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param <Array> $currencies - list of systems active currencies

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param bool    $cron       - if true then it is fired by server and crms currency conversion rates are updated

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Class name "Settings_CurrencyUpdate_AbstractBank_Model" is not in camel caps format
Open

abstract class Settings_CurrencyUpdate_AbstractBank_Model

There are no issues that match your filters.

Category
Status