Showing 10 of 11 total issues
Attachment
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class Attachment
{
/** @var string */
private $color;
Method sendTestMessage
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function sendTestMessage()
{
$slackMessage = new SlackMessage(
'Simple Symfony 3 and 4 Bundle for sending customizable messages to Slack via '
. SlackMarkdown::link('incoming webhooks', 'https://api.slack.com/incoming-webhooks')
Method __construct
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
string $color = '',
string $pretext = '',
string $authorName = '',
string $authorLink = '',
string $authorIconUrl = '',
Method getConfigTreeBuilder
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('wow_apps_slack');
$rootNode
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
string $text = '',
string $username = '',
string $channel = '',
string $iconUrl = '',
string $iconEmoji = '',
Function execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
/* Work with container for support of Symfony 3 early versions */
$this->slackBot = $this->getContainer()->get('wowapps.slackbot');
$this->config = $this->slackBot->getConfig();
- 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 __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
bool $active = false,
string $title = '',
string $text = '',
string $buttonOkText = self::BUTTON_DEFAULT_TEXT_OK,
string $buttonDismissText = self::BUTTON_DEFAULT_TEXT_DISMISS
Function attachmentDto
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function attachmentDto(Attachment $attachment)
{
if (!in_array($attachment->getColor(), SlackColor::COLOR_MAP)) {
throw new SlackbotException(SlackbotException::E_INCORRECT_COLOR);
}
- 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 list
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function list(array $list, string $listType = self::LIST_MARKER): string
{
if (empty($list)) {
throw new SlackbotException(SlackbotException::E_EMPTY_LIST);
}
- 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 checkIcon
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function checkIcon(SlackMessage $message)
{
if (!empty($message->getIconUrl())) {
if (!preg_match(
'/^(?:http|https|ftp)\:\/\/(.*?)\.(.*?)\/(.*?)\.(?:jpg|jpeg|png)/i',
- 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"