retracedhq/monkit

View on GitHub

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 {
Severity: Minor
Found in src/StatsdReporter.ts - About 1 hr to fix

    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;
    
    
    Severity: Minor
    Found in src/test/StatsdReporterTest.ts - About 1 hr to fix

      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;
      
      
      Severity: Minor
      Found in src/test/StatsdReporterTest.ts - About 1 hr to fix

        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;
        
        
        Severity: Minor
        Found in src/test/StatsdReporterTest.ts - About 1 hr to fix

          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) => {
          Severity: Minor
          Found in src/StatusPageReporter.ts - About 1 hr to fix

            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[] = [];
            Severity: Minor
            Found in src/Registry.ts - About 35 mins to fix

            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) {
            Severity: Minor
            Found in src/SysdigNameRewriter.ts - About 35 mins to fix

            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 {
            Severity: Minor
            Found in src/StatsdReporter.ts - About 25 mins to fix

            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

            Severity
            Category
            Status
            Source
            Language