Showing 10 of 24 total issues
Function getLap
has a Cognitive Complexity of 37 (exceeds 10 allowed). Consider refactoring. Open
function getLap(node: Element): Feature | null {
const segments = $(node, "Track");
const track = [];
const times = [];
const heartRates = [];
- 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 getGeometry
has a Cognitive Complexity of 36 (exceeds 10 allowed). Consider refactoring. Open
export function getGeometry(node: Element): GeometriesAndTimes {
let geometries: Geometry[] = [];
let coordTimes: string[][] = [];
for (let i = 0; i < node.childNodes.length; 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"
Further reading
Function getTrack
has a Cognitive Complexity of 25 (exceeds 10 allowed). Consider refactoring. Open
function getTrack(node: Element): Feature<LineString | MultiLineString> | null {
const segments = $(node, "trkseg");
const track = [];
const times = [];
const extractedLines = [];
- 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 getGeometry
has 67 lines of code (exceeds 50 allowed). Consider refactoring. Open
export function getGeometry(node: Element): GeometriesAndTimes {
let geometries: Geometry[] = [];
let coordTimes: string[][] = [];
for (let i = 0; i < node.childNodes.length; i++) {
Function getLap
has 67 lines of code (exceeds 50 allowed). Consider refactoring. Open
function getLap(node: Element): Feature | null {
const segments = $(node, "Track");
const track = [];
const times = [];
const heartRates = [];
Function kmlWithFolders
has a Cognitive Complexity of 18 (exceeds 10 allowed). Consider refactoring. Open
export function kmlWithFolders(
node: Document,
options: KMLOptions = {
skipNullGeometry: false,
}
- 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 getTrack
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
function getTrack(node: Element): Feature<LineString | MultiLineString> | null {
const segments = $(node, "trkseg");
const track = [];
const times = [];
const extractedLines = [];
Function getPoints
has a Cognitive Complexity of 14 (exceeds 10 allowed). Consider refactoring. Open
function getPoints(node: Element) {
const pts = $(node, "Trackpoint");
const line: Position[] = [];
const times = [];
const heartRates = [];
- 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 getPoints
has a Cognitive Complexity of 14 (exceeds 10 allowed). Consider refactoring. Open
function getPoints(node: Element, pointname: "trkpt" | "rtept") {
const pts = $(node, pointname);
const line: Position[] = [];
const times = [];
const extendedValues: P = {};
- 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
Avoid deeply nested control flow statements. Open
if (ring.length >= 4) {
coords.push(ring);
}