renatomefidf/sammui

View on GitHub

Showing 44 of 44 total issues

Avoid too many return statements within this function.
Open

                        return field.options[field.free_text_option] + ': ' + field.value;

    Function assertJsonResponse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function assertJsonResponse($response, $statusCode = Response::HTTP_OK, $convert = false, $isArray = false)
        {
    
            if (is_array($statusCode)) {
                $this->assertTrue(in_array($response->getStatusCode(), $statusCode),
    Severity: Minor
    Found in src/Renatomefi/TestBundle/Rest/AssertRestUtils.php - 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

    Function onLogoutSuccess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function onLogoutSuccess(Request $request)
        {
            if ($accessToken = $this->accessTokenManager->findTokenByToken($request->get('access_token'))) {
                $this->accessTokenManager->deleteToken($accessToken);
            }
    Severity: Minor
    Found in src/Renatomefi/ApiBundle/OAuth/LogoutSuccess.php - 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

    Function patchAddUserAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function patchAddUserAction($protocolId, $userName)
        {
            $dm = $this->get('doctrine_mongodb')->getManager();
    
            $protocol = $this->getProtocol($protocolId);
    Severity: Minor
    Found in src/Renatomefi/FormBundle/Controller/ProtocolController.php - 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