Showing 18 of 39 total issues
File geo.ts
has 756 lines of code (exceeds 250 allowed). Consider refactoring. Open
const statesOrProvinces = {
SIB: 'Siberia',
STP: 'Saint Petersburg',
Function desc
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
desc(record: UdbOutputRecord) {
const ref = record.ref ? record.ref : ""
const month = record.month
const day = record.day
- 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
File flags.ts
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
export class Flags {
/**
* Location of the OBSERVER.
* @type {{MAP: string, GND: string, CST: string, SEA: string, AIR: string, MIL: string, CIV: string, HQO: string}}
*/
Function desc
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
desc(record: UdbOutputRecord) {
const ref = record.ref ? record.ref : ""
const month = record.month
const day = record.day
Function read
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
read(filePos: number, recordIndex?: number): UdbInputRecord {
const record = <UdbInputRecord>super.read(filePos, recordIndex);
this.readSignedInt('year');
this.readNibbles('unknownLocale', 'locale');
Function execute
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
async execute(matchCriteria: string, firstIndex: number, maxCount: number, format: boolean = true,
allowEmpty: boolean = true): Promise<void> {
this.logger.logVerbose(`Querying...`)
const processingStart = Date.now()
const recordEnumerator: RecordEnumerator = this.input.recordEnumerator(firstIndex, maxCount)
- 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 constructor
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
constructor(private criteria = '', private allowEmpty = true) {
const andCriterions = criteria.split('&');
for (let a = 0; a < andCriterions.length; ++a) {
let type: string = 'and';
const andCriterion = andCriterions[a];
- 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 execute
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
async execute(matchCriteria: string, firstIndex: number, maxCount: number, format: boolean = true,
allowEmpty: boolean = true): Promise<void> {
this.logger.logVerbose(`Querying...`)
const processingStart = Date.now()
const recordEnumerator: RecordEnumerator = this.input.recordEnumerator(firstIndex, maxCount)
Function start
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
start() {
const rl = readline.createInterface({input: process.stdin, output: process.stdout})
rl.setPrompt("udb> ")
rl.prompt()
Function formatData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
formatData(rec: UdbInputRecord): UdbOutputRecord {
const record: UdbOutputRecord = <UdbOutputRecord>Util.copy(rec);
let continent = Geo.getContinent(rec.continentCode);
if (continent) {
record.continent = continent.name;
Function open
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
open(sourcesReader: ReadInterface): Promise<void> {
return new Promise((resolve, reject) => {
sourcesReader
.on("line", line => {
switch (line.charAt(0)) {
Function getLinks
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getLinks(pageContents: WebRecord, linkCheck: LinkCheck): string[] {
const reports = [];
let pos = 0;
let reportLinkStart;
let done = 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 formatProperties
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
formatProperties(record: UdbInputRecord): UdbOutputRecord {
delete record.unknownMonth;
delete record.unknownLocale;
delete record.refIndexHigh;
delete record.ymdt;
- 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 fetch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private fetch(reject) {
let remaining = this.queue.length > 0 || this.reading > 0;
if (remaining) {
if (this.queue.length > 0 && this.reading <= this.maxConcurrent) {
let read = this.queue.shift();
- 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 formatProperties
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
formatProperties(record: NuforcInputRecord): NuforcOutputRecord {
let expectedKeysOrder = ["source", "occurred", "entered", "reported", "posted", "location", "shape", "duration", "desc"]
let sortedRecord: NuforcOutputRecord = <NuforcOutputRecord>Util.sortProps(record, (prop1, prop2) => {
let index1 = expectedKeysOrder.indexOf(prop1);
if (index1 < 0) index1 = 1000;
- 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 getStateOrProvince
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static getStateOrProvince(country, record) {
let stateOrProvinceKey = record.stateOrProvince;
let end;
let found;
do {
- 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 getDay
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static getDay(record, padding = false) {
const dayAccuracy = (record.ymdt >> 2) & 0b11;
let day = padding ? (record.day > 31 ? '--' : (record.day < 10 ? '0' : '') + record.day) : record.day;
return Time.accuracy(day, dayAccuracy, padding);
}
- 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 ddToDms
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static ddToDms(lat: number, lng: number) {
let latResult = Geo.getDms(lat) + ' ';
latResult += !lat ? 'Q' : lat > 0 ? 'N' : 'S';
let lngResult = Geo.getDms(lng) + ' ';
- 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"