OWASP/SSO_Project

View on GitHub

Showing 24 of 52 total issues

Avoid deeply nested control flow statements.
Open

                            if(!passCertificate) {
                                return res.status(403).send("Certificate denied by page");
                            } else {
                                Audit.add(req, "authenticator", "login", thisPage.name + " certificate").then(() => {
                                    next();
Severity: Major
Found in js-backend/flows/authenticator-cert.js - About 45 mins to fix

    Function beforeMount has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        async beforeMount() {
            const activeUser = this.getActiveUser();
            if(activeUser) {
                this.useLoginToken(activeUser);
            }
    Severity: Minor
    Found in vue-ui/src/main.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 onCertLogin has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        async onCertLogin(req, res, next) {
            const certResp = this.getCert(req, res);
            if(certResp === false) {
                return;
            }
    Severity: Minor
    Found in js-backend/flows/authenticator-cert.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 onFlowOut has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        onFlowOut(req, res, next) {
            const jwtRequest = req.ssoRequest;
            if(!jwtRequest) {
                return res.status(400).send("No SSO request forwarded");
            }
    Severity: Minor
    Found in js-backend/flows/sso-flow.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