Showing 223 of 419 total issues
Function updateInheritedAccount
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function updateInheritedAccount()
{
if (!Podium::getInstance()->user->isGuest) {
$userNameField = Podium::getInstance()->userNameField;
if ($userNameField === null) {
- 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 updateWords
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function updateWords()
{
try {
$vocabulary = [];
$allWords = $this->prepareWords();
- 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
Method podiumDelete
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function podiumDelete()
{
$transaction = static::getDb()->beginTransaction();
try {
if (!$this->delete()) {
Method actionIgnore
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionIgnore($id = null)
{
if (Podium::getInstance()->user->isGuest) {
return $this->redirect(['forum/index']);
}
Method updateModeratorForMany
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateModeratorForMany($newForums = [], $oldForums = [])
{
$transaction = static::getDb()->beginTransaction();
try {
$add = [];
Method nextStep
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function nextStep()
{
$currentStep = Yii::$app->session->get(self::SESSION_KEY, 0);
if ($currentStep === 0) {
Yii::$app->session->set(self::SESSION_STEPS, count($this->versionSteps));
Method updateWords
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function updateWords()
{
try {
$vocabulary = [];
$allWords = $this->prepareWords();
Method getIcon
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getIcon()
{
$icon = self::ICON_NO_NEW;
$append = false;
Method actionForum
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionForum($cid = null, $id = null, $slug = null, $toggle = null)
{
$filters = Yii::$app->session->get('forum-filters');
if (in_array(strtolower($toggle), ['new', 'edit', 'hot', 'pin', 'lock', 'all'])) {
if (strtolower($toggle) == 'all') {
Function actionAdd
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function actionAdd($id = null)
{
if (!Yii::$app->request->isAjax) {
return $this->redirect(['forum/index']);
}
- 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 podiumReport
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function podiumReport($post = null)
{
try {
if (empty($post)) {
throw new Exception('Reported post missing');
- 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 update
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function update($data)
{
$validator = new StringValidator();
$validator->max = 255;
- 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 timeZones
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function timeZones()
{
$timeZones = [];
$timezone_identifiers = DateTimeZone::listIdentifiers();
- 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 getMods
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getMods()
{
$mods = Podium::getInstance()->podiumCache->getElement('forum.moderators', $this->id);
if ($mods === false) {
$mods = [];
- 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 updateModeratorForMany
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function updateModeratorForMany($newForums = [], $oldForums = [])
{
$transaction = static::getDb()->beginTransaction();
try {
$add = [];
- 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 actionBan
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function actionBan($id = null)
{
$model = User::find()->where(['id' => $id])->limit(1)->one();
if (empty($model)) {
$this->error(Yii::t('podium/flash', 'Sorry! We can not find Member with this ID.'));
- 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
Method demoteTo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function demoteTo($role)
{
$transaction = static::getDb()->beginTransaction();
try {
$this->scenario = 'role';
Method notify
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function notify($thread)
{
if (is_numeric($thread) && $thread > 0) {
$forum = Podium::getInstance()->podiumConfig->get('name');
$email = Content::fill(Content::EMAIL_SUBSCRIPTION);
Method actionLoad
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionLoad()
{
if (!Yii::$app->request->isAjax) {
return $this->redirect(['forum/index']);
}
Method actionFriend
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionFriend($id = null)
{
if (Podium::getInstance()->user->isGuest) {
return $this->redirect(['forum/index']);
}