renatomefidf/sammui

View on GitHub

Showing 29 of 44 total issues

Method queryLangTranslationManage has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected function queryLangTranslationManage($method = 'GET', $params = false, $noKey = false, $assertJson = true, $authRole = null)
Severity: Minor
Found in src/Renatomefi/TranslateBundle/Tests/Controller/ManageControllerTest.php - About 35 mins to fix

    Function link has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

                link: function ($scope, $element, $attrs, controller, $transclude) {

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

          public function __construct(FormField $field = null, $customValue = null)
          {
              $this->customValue = [];
      
              if (null !== $field) {
      Severity: Minor
      Found in src/Renatomefi/FormBundle/Document/FormFieldDepends.php - 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

      Avoid too many return statements within this function.
      Open

                              return field.options[field.value];

        Avoid too many return statements within this function.
        Open

                    return field.value;

          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