Showing 34 of 327 total issues
Method createExpectedArray
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createExpectedArray()
{
return [
'waypoints' => [
[
Method createExpectedArray
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createExpectedArray()
{
return [
'creator' => 'RouteConverter',
'metadata' => [
Function parse
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public static function parse($nodes)
{
$routes = [];
foreach ($nodes as $node) {
- 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 recalculateStats
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function recalculateStats()
{
if (empty($this->stats)) {
$this->stats = new Stats();
}
- 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 toXML
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function toXML(Metadata $metadata, \DOMDocument &$document)
{
$node = $document->createElement(self::$tagName);
foreach (self::$attributeMapper as $key => $attribute) {
- 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 recalculateStats
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function recalculateStats()
{
if (empty($this->stats)) {
$this->stats = new Stats();
}
Function parse
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function parse(\SimpleXMLElement $nodes)
{
$tracks = [];
foreach ($nodes as $node) {
- 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 calculate
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function calculate(array $points)
{
$cumulativeElevationGain = 0;
$cumulativeElevationLoss = 0;
- 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 toXML
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function toXML(Point $point, \DOMDocument &$document)
{
$node = $document->createElement(array_search($point->getPointType(), self::$typeMapper));
$node->setAttribute('lat', $point->latitude);
- 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 recalculateStats
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function recalculateStats()
{
if (empty($this->stats)) {
$this->stats = new Stats();
}
- 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 toXML
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function toXML(Route $route, \DOMDocument &$document)
{
$node = $document->createElement(self::$tagName);
foreach (self::$attributeMapper as $key => $attribute) {
- 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 toXML
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function toXML(Track $track, \DOMDocument &$document)
{
$node = $document->createElement(self::$tagName);
foreach (self::$attributeMapper as $key => $attribute) {
- 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 createWaypointFile
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createWaypointFile()
{
$sample_data = [
[
'longitude' => 9.860624216140083,
Function recalculateStats
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function recalculateStats()
{
if (empty($this->stats)) {
$this->stats = new Stats();
}
- 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 recalculateStats
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function recalculateStats()
{
if (empty($this->stats)) {
$this->stats = new Stats();
}
Method toXML
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toXML()
{
$document = new \DOMDocument("1.0", 'UTF-8');
$gpx = $document->createElementNS("http://www.topografix.com/GPX/1/1", "gpx");
Function parse
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function parse(\SimpleXMLElement $node)
{
$metadata = new Metadata();
foreach (self::$attributeMapper as $key => $attribute) {
- 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 dataProviderFilterNotNull
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function dataProviderFilterNotNull()
{
return [
'numeric 1' => [
[],
Method recalculateStats
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function recalculateStats()
{
if (empty($this->stats)) {
$this->stats = new Stats();
}
Method toXML
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function toXML(Metadata $metadata, \DOMDocument &$document)
{
$node = $document->createElement(self::$tagName);
foreach (self::$attributeMapper as $key => $attribute) {