Showing 18 of 20 total issues
UserInformation
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class UserInformation
{
/** 男性 */
const SEX_MALE = '男';
/** 女性 */
File UserInformation.php
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* 送信パラメータのうち、利用者に関するパラメータを管理するクラス
* @author AIZAWA Hina <hina@bouhime.com>
* @copyright 2015 by AIZAWA Hina <hina@bouhime.com>
Avoid too many return
statements within this method. Open
Open
return $this->getBirthdateD();
Avoid too many return
statements within this method. Open
Open
return $this->setUserInformation($value);
Avoid too many return
statements within this method. Open
Open
return $this->getConstellations();
Avoid too many return
statements within this method. Open
Open
return $this->getAge();
Avoid too many return
statements within this method. Open
Open
return $this->getUserInformation();
Avoid too many return
statements within this method. Open
Open
return $this->setBirthdateD($value);
Avoid too many return
statements within this method. Open
Open
return $this->setAge($value);
Avoid too many return
statements within this method. Open
Open
return $this->setBirthdateM($value);
Avoid too many return
statements within this method. Open
Open
return $this->setConstellations($value);
Avoid too many return
statements within this method. Open
Open
return $this->setPlace($value);
Avoid too many return
statements within this method. Open
Open
return $this->getPlace();
Avoid too many return
statements within this method. Open
Open
return $this->getBirthdateY();
Avoid too many return
statements within this method. Open
Open
return $this->getNumber();
Avoid too many return
statements within this method. Open
Open
return $this->setBirthdateY($value);
Avoid too many return
statements within this method. Open
Open
return $this->getBirthdateM();
Function __construct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public function __construct(stdClass $response)
{
foreach (['utt', 'yomi', 'mode', 'context'] as $key) {
if (isset($response->$key)) {
$this->parameters[$key] = (string)$response->$key;
- 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"