rcatlin/ryancatlin-info

View on GitHub

Showing 30 of 30 total issues

Method __construct has 265 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct()
    {
        /* mandatory requirements follow */

        $installedPhpVersion = phpversion();
Severity: Major
Found in app/SymfonyRequirements.php - About 1 day to fix

    File SymfonyRequirements.php has 427 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /*
     * This file is part of the Symfony package.
     *
    Severity: Minor
    Found in app/SymfonyRequirements.php - About 6 hrs to fix

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

          public function __construct()
          {
              /* mandatory requirements follow */
      
              $installedPhpVersion = phpversion();
      Severity: Minor
      Found in app/SymfonyRequirements.php - About 4 hrs 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

                  isExistingNewTagName: function (tagName) {
                      var exists = false;
      
                      // Check new
                      Object
      src/MyProject/Bundle/AdminBundle/Resources/public/js/tag_autocomplete.js on lines 236..253

      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 109.

      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

                  findExistingInactiveTagIdByName: function (tagName)
                  {
                      var tagId = undefined;
      
                      // Check inactive
      src/MyProject/Bundle/AdminBundle/Resources/public/js/tag_autocomplete.js on lines 296..315

      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 109.

      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

                  findExistingNewTagKeyByName: function (tagName)
                  {
                      var newKey = undefined;
      
                      // Check inactive
      src/MyProject/Bundle/AdminBundle/Resources/public/js/tag_autocomplete.js on lines 276..295

      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 109.

      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

                  isExistingActiveTagName: function (tagName) {
                      var exists = false;
      
                      // Check active
                      Object
      src/MyProject/Bundle/AdminBundle/Resources/public/js/tag_autocomplete.js on lines 257..275

      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 109.

      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

      File tag_autocomplete.js has 319 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      $(document).ready(
          function() {
              // Selectors
              var selectors = {
                  'articleTags':  '#article_tags',

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

        <?php
        
        namespace MyProject\Bundle\AdminBundle\Controller;
        
        use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
        src/MyProject/Bundle/AdminBundle/Controller/ArticleShowController.php on lines 1..64

        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 145.

        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
        
        namespace MyProject\Bundle\AdminBundle\Controller;
        
        use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
        src/MyProject/Bundle/AdminBundle/Controller/TagShowController.php on lines 1..64

        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 145.

        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

        Method buildForm has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function buildForm(FormBuilderInterface $builder, array $options)
            {
                $builder
                    ->add('slug')
                    ->add('title')
        Severity: Major
        Found in src/MyProject/Bundle/AdminBundle/Form/ArticleType.php - About 2 hrs to fix

          Function exports has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function (grunt) {
              grunt.initConfig({
                  pkg: grunt.file.readJSON('package.json'),
                  bowercopy: {
                      options: {
          Severity: Minor
          Found in Gruntfile.js - About 2 hrs to fix

            Function bindAutocompleteFormSubmission has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        bindAutocompleteFormSubmission: function () {
                            /** 
                             * Prevents enter key in autocomplete field
                             * from triggering form submission.
                             *

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

                              Object
                                  .keys(
                                      tag_ac.tagData['new']
                                  )
                                  .forEach(
              src/MyProject/Bundle/AdminBundle/Resources/public/js/tag_autocomplete.js on lines 47..57

              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 64.

              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

                              Object
                                  .keys(
                                      tag_ac.tagData['active']
                                  )
                                  .forEach(
              src/MyProject/Bundle/AdminBundle/Resources/public/js/tag_autocomplete.js on lines 35..44

              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 64.

              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

              Method updateAction has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function updateAction(Request $request, $id)
                  {
                      $entity = $this->getArticleRepository()->find($id);
              
                      if (!$entity) {

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

                    public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
                    {
                        $cfgValue = ini_get($cfgName);
                
                        if (is_callable($evaluation)) {
                Severity: Minor
                Found in app/SymfonyRequirements.php - About 1 hr 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

                Method createAction has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function createAction(Request $request)
                    {
                        $entity = new Article();
                        $form = $this->createCreateForm($entity);
                        $form->handleRequest($request);

                  Function updateAction has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function updateAction(Request $request, $id)
                      {
                          $entity = $this->getArticleRepository()->find($id);
                  
                          if (!$entity) {

                  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 appendTag has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              appendTag: function (type, key, name) {
                                  // Check if we should clear tag area
                                  // before adding first button
                                  var $buttons = $activeTags.find('button');
                                  if ($buttons.length <= 0) {
                    Severity
                    Category
                    Status
                    Source
                    Language