webdriverio/wdio-allure-reporter

View on GitHub

Showing 6 of 14 total issues

AllureReporter has 45 functions (exceeds 20 allowed). Consider refactoring.
Open

class AllureReporter extends events.EventEmitter {
    constructor (baseReporter, config, options = {}) {
        super()

        this.baseReporter = baseReporter
Severity: Minor
Found in lib/reporter.js - About 6 hrs to fix

    File reporter.js has 357 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import process from 'process'
    import events from 'events'
    import Allure from 'allure-js-commons'
    import Step from 'allure-js-commons/beans/step'
    import {getTestStatus, isEmpty, PASSED, BROKEN, FAILED} from './utils'
    Severity: Minor
    Found in lib/reporter.js - About 4 hrs to fix

      Function constructor has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          constructor (baseReporter, config, options = {}) {
              super()
      
              this.baseReporter = baseReporter
              this.config = config
      Severity: Minor
      Found in lib/reporter.js - About 1 hr to fix

        Function runnerResult has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            runnerResult (command) {
                if (this.isMultiremote) {
                    return
                }
        
        
        Severity: Minor
        Found in lib/reporter.js - About 55 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 getTestStatus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export function getTestStatus (test, config) {
            let status = FAILED
        
            if (config.framework === 'jasmine') {
                return status
        Severity: Minor
        Found in lib/utils.js - 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 cucumberSuiteStart has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            cucumberSuiteStart (suite) {
                const allure = this.getAllure(suite.cid)
        
                if (!suite.parent) {
                    const currentSuite = allure.getCurrentSuite()
        Severity: Minor
        Found in lib/reporter.js - 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