File SimpleMimeEntity.php
has 472 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of SwiftMailer.
* (c) 2004-2009 Chris Corbyn
Swift_Mime_SimpleMimeEntity
has 51 functions (exceeds 20 allowed). Consider refactoring. Open
class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
{
/** A collection of Headers for this mime entity */
private $_headers;
Function _bodyToByteStream
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
protected function _bodyToByteStream(Swift_InputByteStream $is)
{
if (empty($this->_immediateChildren)) {
if (isset($this->_body)) {
if ($this->_cache->hasKey($this->_cacheKey, 'body')) {
- 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 setChildren
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function setChildren(array $children, $compoundLevel = null)
{
// TODO: Try to refactor this logic
$compoundLevel = isset($compoundLevel)
- 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 setChildren
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setChildren(array $children, $compoundLevel = null)
{
// TODO: Try to refactor this logic
$compoundLevel = isset($compoundLevel)
Method _bodyToByteStream
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _bodyToByteStream(Swift_InputByteStream $is)
{
if (empty($this->_immediateChildren)) {
if (isset($this->_body)) {
if ($this->_cache->hasKey($this->_cacheKey, 'body')) {
Function _bodyToString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function _bodyToString()
{
$string = '';
if (isset($this->_body) && empty($this->_immediateChildren)) {
- 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 _getNeededChildLevel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function _getNeededChildLevel($child, $compoundLevel)
{
$filter = array();
foreach ($this->_compoundLevelFilters as $bitmask => $rules) {
if (($compoundLevel & $bitmask) === $bitmask) {
- 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"