Showing 8 of 75 total issues
Function report
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public report(): void {
const metrics = this.registry.getMetrics();
try {
Function StatsdReporter#report()
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
@test public "StatsdReporter#report()"() {
const client = TypeMoq.Mock.ofType(StatsdClient);
const fiveMsInNanos = 5000000;
const fiveMs = 5;
Function StatsdReporter#report() with nameRewriter
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
@test public "StatsdReporter#report() with nameRewriter"() {
const client = TypeMoq.Mock.ofType(StatsdClient);
const fiveMsInNanos = 5000000;
const fiveMs = 5;
Function StatsdReporter#report() without prefix
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
@test public "StatsdReporter#report() without prefix"() {
const client = TypeMoq.Mock.ofType(StatsdClient);
const fiveMsInNanos = 5000000;
const fiveMs = 5;
Function report
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public report(): void {
const metrics = this.registry.getMetrics();
if (metrics.counters.length !== 0) {
metrics.counters.forEach((count) => {
Function getMetrics
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public getMetrics(): any {
const meters: any[] = [];
const timers: any[] = [];
const counters: any[] = [];
const histograms: any[] = [];
- 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 rewriteName
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public rewriteName(name: string) {
const parts = name.split(".");
const maxIndex = parts.length - 1;
let acc = "";
for (const { dimension, position } of this.schema) {
- 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 report
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public report(): void {
const metrics = this.registry.getMetrics();
try {
- 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"