Showing 26 of 52 total issues
Function parseOptions
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
parseOptions(options) {
var _a, _b, _c, _d;
let config = {};
config.options = DefaultOptions_1.default.fileStreamRotatorOptions(options);
config.fileOptions = DefaultOptions_1.default.fileOptions((_a = options.file_options) !== null && _a !== void 0 ? _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 constructor
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
constructor(settings, lastEntry) {
var _a;
this.currentSize = 0;
this.lastDate = "";
this.fileIndx = 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 constructor
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
constructor(settings: RotationSettings, lastEntry?: AuditEntry){
this.settings = settings
// if (!this.settings.format) {
// this.settings.frequency = Frequency.none
// Logger.log("[FileStreamRotator] Changing type to none as date format is missing");
- 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 parseOptions
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private parseOptions(options: Partial<FileStreamRotatorOptions>): FileStreamRotatorConfig {
let config: FileStreamRotatorConfig = {}
config.options = DefaultOptions.fileStreamRotatorOptions(options)
config.fileOptions = DefaultOptions.fileOptions(options.file_options ?? {})
- 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 parseOptions
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseOptions(options) {
var _a, _b, _c, _d;
let config = {};
config.options = DefaultOptions_1.default.fileStreamRotatorOptions(options);
config.fileOptions = DefaultOptions_1.default.fileOptions((_a = options.file_options) !== null && _a !== void 0 ? _a : {});
Function parseOptions
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
private parseOptions(options: Partial<FileStreamRotatorOptions>): FileStreamRotatorConfig {
let config: FileStreamRotatorConfig = {}
config.options = DefaultOptions.fileStreamRotatorOptions(options)
config.fileOptions = DefaultOptions.fileOptions(options.file_options ?? {})
Function constructor
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(settings, lastEntry) {
var _a;
this.currentSize = 0;
this.lastDate = "";
this.fileIndx = 0;
Function constructor
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(settings: RotationSettings, lastEntry?: AuditEntry){
this.settings = settings
// if (!this.settings.format) {
// this.settings.frequency = Frequency.none
// Logger.log("[FileStreamRotator] Changing type to none as date format is missing");
Function addLog
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
addLog(name) {
var _a;
if (!this.config.keepSettings || ((_a = this.config.keepSettings) === null || _a === void 0 ? void 0 : _a.amount) == 0 || !this.config.auditFilename || this.config.auditFilename == "") {
helper_1.Logger.verbose("audit log missing");
return;
- 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 addLog
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
addLog(name: string) {
if (!this.config.keepSettings || this.config.keepSettings?.amount == 0 || !this.config.auditFilename || this.config.auditFilename == "") {
Logger.verbose("audit log missing")
return
}
- 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 getDateString
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
getDateString(date) {
let _date = date || new Date();
let components = Rotator.getDateComponents(_date, this.settings.utc);
let format = this.settings.format;
if (format) {
- 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 addLog
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
addLog(name) {
var _a;
if (!this.config.keepSettings || ((_a = this.config.keepSettings) === null || _a === void 0 ? void 0 : _a.amount) == 0 || !this.config.auditFilename || this.config.auditFilename == "") {
helper_1.Logger.verbose("audit log missing");
return;
Function addLog
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
addLog(name: string) {
if (!this.config.keepSettings || this.config.keepSettings?.amount == 0 || !this.config.auditFilename || this.config.auditFilename == "") {
Logger.verbose("audit log missing")
return
}
Function createCurrentSymLink
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
createCurrentSymLink(logfile) {
var _a, _b;
if (!logfile) {
return;
}
- 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 getDateString
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
getDateString(date?: Date): string {
let _date: Date = date || new Date()
let components: DateComponents = Rotator.getDateComponents(_date, this.settings.utc)
- 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 getDateString
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
getDateString(date?: Date): string {
let _date: Date = date || new Date()
let components: DateComponents = Rotator.getDateComponents(_date, this.settings.utc)
Function createCurrentSymLink
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
createCurrentSymLink(logfile) {
var _a, _b;
if (!logfile) {
return;
}
Function rotate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
rotate(force = false) {
var _a;
let oldFile = this.currentFile;
this.rotator.rotate(force);
this.currentFile = this.rotator.getNewFilename();
- 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 write
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
write(str, encoding) {
if (this.fs) {
if (this.rotator.shouldRotate()) {
this.rotate();
}
- 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 extractParam
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static extractParam(param, lowercase = true) {
let letter = param.toString().match(/(\w)$/);
let rtn = { number: 0 };
if ((letter === null || letter === void 0 ? void 0 : letter.length) == 2) {
rtn.letter = letter[1].toLowerCase();
- 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"