renatomefidf/sammui

View on GitHub

Showing 44 of 44 total issues

Function getData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            publicFunctions.getData = function (protocolId) {

                if (!currentData[protocolId]) {

                    currentData[protocolId] = formProtocolManage.get({protocolId: protocolId});

    Method pdfAction has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function pdfAction($protocolId, $lang)
        {
            $this->languageKey = $lang;
    
            $protocol = $this->getProtocol($protocolId);
    Severity: Minor
    Found in src/Renatomefi/FormBundle/Controller/ProtocolExportController.php - About 1 hr to fix

      Function langKeysTable has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  $scope.langKeysTable = function (lang, reload) {
      
                      lang = lang || $location.search().lang;
                      reload = reload || false;
      
      

        Method getValueInHR has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getValueInHR()
            {
                $value = $this->value;
                $opts = $this->getField()->getOptions();
                $isMulti = (count($opts) > 0);
        Severity: Minor
        Found in src/Renatomefi/FormBundle/Document/ProtocolFieldValue.php - About 1 hr to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                          if (lock === false) {
                              lockProcess($scope.protocol.id, formProtocolLock.unlock(
                                  {protocolId: $scope.protocol.id}
                              ).$promise);
                          }
          src/Renatomefi/FormBundle/Resources/public/angular/form/controllers/formAdminControllers.js on lines 86..90

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 53.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                          if (lock === true) {
                              lockProcess($scope.protocol.id, formProtocolLock.lock(
                                  {protocolId: $scope.protocol.id}
                              ).$promise);
                          }
          src/Renatomefi/FormBundle/Resources/public/angular/form/controllers/formAdminControllers.js on lines 91..95

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 53.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          <?php
          
          use Symfony\Component\ClassLoader\ApcClassLoader;
          use Symfony\Component\HttpFoundation\Request;
          
          
          Severity: Minor
          Found in web/app.php and 1 other location - About 55 mins to fix
          web/app_dev.php on lines 1..29

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 98.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          <?php
          
          use Symfony\Component\HttpFoundation\Request;
          
          // If you don't want to setup permissions the proper way, just uncomment the following PHP line
          Severity: Minor
          Found in web/app_dev.php and 1 other location - About 55 mins to fix
          web/app.php on lines 1..26

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 98.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              protected function assertUserInfoObjAdminAuth($userInfo)
              {
                  $this->assertTrue($userInfo->authenticated);
                  $this->assertTrue($userInfo->authenticated_fully);
                  $this->assertTrue($userInfo->authenticated_anonymously);
          Severity: Minor
          Found in src/Renatomefi/ApiBundle/Tests/Auth/AssertUserInfo.php and 1 other location - About 45 mins to fix
          src/Renatomefi/ApiBundle/Tests/Auth/AssertUserInfo.php on lines 29..39

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 96.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              protected function assertUserInfoObjNoAuth($userInfo)
              {
                  $this->assertTrue($userInfo->authenticated);
                  $this->assertFalse($userInfo->authenticated_fully);
                  $this->assertTrue($userInfo->authenticated_anonymously);
          Severity: Minor
          Found in src/Renatomefi/ApiBundle/Tests/Auth/AssertUserInfo.php and 1 other location - About 45 mins to fix
          src/Renatomefi/ApiBundle/Tests/Auth/AssertUserInfo.php on lines 44..54

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 96.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Avoid deeply nested control flow statements.
          Open

                                          if (field.options[cValue] &&
                                              field.value !== null && field.value !== undefined &&
                                              Object.getOwnPropertyNames(field.value).length > 0 &&
                                              field.value[cValue] === true) {
                                              return false;

            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

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                            if (field.value === 'true' || field.value === true) {
                                return '<em>' + $filter('translate')('form-value-true') + '</em>';
                            }
                src/Renatomefi/FormBundle/Resources/public/angular/form/filters/formFilters.js on lines 16..18

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 46.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                            if (field.value === 'false' || field.value === false) {
                                return '<em>' + $filter('translate')('form-value-false') + '</em>';
                            }
                src/Renatomefi/FormBundle/Resources/public/angular/form/filters/formFilters.js on lines 12..14

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 46.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                        for ($i = 0; $i < count($users); $i++) {
                            /** @var User $user */
                            $user = $users[$i];
                            $position = $i + $currentLine;
                
                
                src/Renatomefi/FormBundle/Controller/ProtocolExportController.php on lines 265..272

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 91.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                        for ($i = 0; $i < count($nonUsers); $i++) {
                            /** @var ProtocolUser $user */
                            $user = $nonUsers[$i];
                            $position = $i + $currentLine;
                
                
                src/Renatomefi/FormBundle/Controller/ProtocolExportController.php on lines 249..256

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 91.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                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;
                    Severity
                    Category
                    Status
                    Source
                    Language