suitmedia/suitcoda

View on GitHub
tests/Supports/ResultReaderTest.php

Summary

Maintainability
F
1 wk
Test Coverage

File ResultReaderTest.php has 469 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace SuitTests\Supports;

use Illuminate\Foundation\Testing\DatabaseTransactions;
Severity: Minor
Found in tests/Supports/ResultReaderTest.php - About 7 hrs to fix

    ResultReaderTest has 28 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ResultReaderTest extends TestCase
    {
        use DatabaseTransactions;
    
        /**
    Severity: Minor
    Found in tests/Supports/ResultReaderTest.php - About 3 hrs to fix

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

          public function testRunPageSpeedResultReader()
          {
              $json = json_encode([
                  'id' => 'https://example.com/',
                  'formattedResults' => [
      Severity: Minor
      Found in tests/Supports/ResultReaderTest.php - About 1 hr to fix

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

            public function testRunYslowResultReader()
            {
                $json = json_encode([
                    'url' => 'https://example.com/',
                    'name' => 'YSlow',
        Severity: Minor
        Found in tests/Supports/ResultReaderTest.php - About 1 hr to fix

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

              public function testRunSoccialMediaResultReader()
              {
                  $json = json_encode([
                      'url' => 'https://example.com/',
                      'name' => 'Social Media Linter',
          Severity: Minor
          Found in tests/Supports/ResultReaderTest.php - About 1 hr to fix

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

                public function testRunCssResultReader()
                {
                    $json = json_encode([
                        'url' => 'https://example.com/',
                        'name' => 'Css Linter',
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 2 other locations - About 1 day to fix
            tests/Supports/ResultReaderTest.php on lines 300..329
            tests/Supports/ResultReaderTest.php on lines 418..447

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

            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 3 locations. Consider refactoring.
            Open

                public function testRunHtmlResultReader()
                {
                    $json = json_encode([
                        'url' => 'https://example.com/',
                        'name' => 'HTML Linter',
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 2 other locations - About 1 day to fix
            tests/Supports/ResultReaderTest.php on lines 359..388
            tests/Supports/ResultReaderTest.php on lines 418..447

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

            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 3 locations. Consider refactoring.
            Open

                public function testRunJsResultReader()
                {
                    $json = json_encode([
                        'url' => 'https://example.com/',
                        'name' => 'Js Linter',
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 2 other locations - About 1 day to fix
            tests/Supports/ResultReaderTest.php on lines 300..329
            tests/Supports/ResultReaderTest.php on lines 359..388

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

            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 7 locations. Consider refactoring.
            Open

                public function testRunCssResultReaderCatchException()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 4)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 6 other locations - About 3 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 277..293
            tests/Supports/ResultReaderTest.php on lines 336..352
            tests/Supports/ResultReaderTest.php on lines 454..470
            tests/Supports/ResultReaderTest.php on lines 517..533
            tests/Supports/ResultReaderTest.php on lines 583..599
            tests/Supports/ResultReaderTest.php on lines 646..662

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

            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 7 locations. Consider refactoring.
            Open

                public function testRunSeoResultReaderCatchException()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 1)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 6 other locations - About 3 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 336..352
            tests/Supports/ResultReaderTest.php on lines 395..411
            tests/Supports/ResultReaderTest.php on lines 454..470
            tests/Supports/ResultReaderTest.php on lines 517..533
            tests/Supports/ResultReaderTest.php on lines 583..599
            tests/Supports/ResultReaderTest.php on lines 646..662

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

            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 7 locations. Consider refactoring.
            Open

                public function testRunSoccialMediaResultReaderCatchException()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 6)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 6 other locations - About 3 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 277..293
            tests/Supports/ResultReaderTest.php on lines 336..352
            tests/Supports/ResultReaderTest.php on lines 395..411
            tests/Supports/ResultReaderTest.php on lines 454..470
            tests/Supports/ResultReaderTest.php on lines 583..599
            tests/Supports/ResultReaderTest.php on lines 646..662

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

            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 7 locations. Consider refactoring.
            Open

                public function testRunHtmlResultReaderCatchException()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 3)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 6 other locations - About 3 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 277..293
            tests/Supports/ResultReaderTest.php on lines 395..411
            tests/Supports/ResultReaderTest.php on lines 454..470
            tests/Supports/ResultReaderTest.php on lines 517..533
            tests/Supports/ResultReaderTest.php on lines 583..599
            tests/Supports/ResultReaderTest.php on lines 646..662

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

            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 7 locations. Consider refactoring.
            Open

                public function testRunJsResultReaderCatchException()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 5)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 6 other locations - About 3 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 277..293
            tests/Supports/ResultReaderTest.php on lines 336..352
            tests/Supports/ResultReaderTest.php on lines 395..411
            tests/Supports/ResultReaderTest.php on lines 517..533
            tests/Supports/ResultReaderTest.php on lines 583..599
            tests/Supports/ResultReaderTest.php on lines 646..662

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

            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 7 locations. Consider refactoring.
            Open

                public function testRunPageSpeedResultReaderCatchException()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 8)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 6 other locations - About 3 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 277..293
            tests/Supports/ResultReaderTest.php on lines 336..352
            tests/Supports/ResultReaderTest.php on lines 395..411
            tests/Supports/ResultReaderTest.php on lines 454..470
            tests/Supports/ResultReaderTest.php on lines 517..533
            tests/Supports/ResultReaderTest.php on lines 646..662

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

            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 7 locations. Consider refactoring.
            Open

                public function testRunYslowResultReaderCatchException()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 9)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 6 other locations - About 3 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 277..293
            tests/Supports/ResultReaderTest.php on lines 336..352
            tests/Supports/ResultReaderTest.php on lines 395..411
            tests/Supports/ResultReaderTest.php on lines 454..470
            tests/Supports/ResultReaderTest.php on lines 517..533
            tests/Supports/ResultReaderTest.php on lines 583..599

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

            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 9 locations. Consider refactoring.
            Open

                public function testCallHtmlResultReader()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 3)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 44..59
            tests/Supports/ResultReaderTest.php on lines 66..81
            tests/Supports/ResultReaderTest.php on lines 110..125
            tests/Supports/ResultReaderTest.php on lines 132..147
            tests/Supports/ResultReaderTest.php on lines 154..169
            tests/Supports/ResultReaderTest.php on lines 176..191
            tests/Supports/ResultReaderTest.php on lines 198..213
            tests/Supports/ResultReaderTest.php on lines 220..235

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

            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 9 locations. Consider refactoring.
            Open

                public function testCallJsResultReader()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 5)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 44..59
            tests/Supports/ResultReaderTest.php on lines 66..81
            tests/Supports/ResultReaderTest.php on lines 88..103
            tests/Supports/ResultReaderTest.php on lines 110..125
            tests/Supports/ResultReaderTest.php on lines 154..169
            tests/Supports/ResultReaderTest.php on lines 176..191
            tests/Supports/ResultReaderTest.php on lines 198..213
            tests/Supports/ResultReaderTest.php on lines 220..235

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

            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 9 locations. Consider refactoring.
            Open

                public function testCallPagespeedResultReaderForMobile()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 8)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 44..59
            tests/Supports/ResultReaderTest.php on lines 66..81
            tests/Supports/ResultReaderTest.php on lines 88..103
            tests/Supports/ResultReaderTest.php on lines 110..125
            tests/Supports/ResultReaderTest.php on lines 132..147
            tests/Supports/ResultReaderTest.php on lines 154..169
            tests/Supports/ResultReaderTest.php on lines 176..191
            tests/Supports/ResultReaderTest.php on lines 220..235

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

            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 9 locations. Consider refactoring.
            Open

                public function testCallSeoResultReaderForSeo()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 1)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 66..81
            tests/Supports/ResultReaderTest.php on lines 88..103
            tests/Supports/ResultReaderTest.php on lines 110..125
            tests/Supports/ResultReaderTest.php on lines 132..147
            tests/Supports/ResultReaderTest.php on lines 154..169
            tests/Supports/ResultReaderTest.php on lines 176..191
            tests/Supports/ResultReaderTest.php on lines 198..213
            tests/Supports/ResultReaderTest.php on lines 220..235

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

            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 9 locations. Consider refactoring.
            Open

                public function testCallCssResultReader()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 4)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 44..59
            tests/Supports/ResultReaderTest.php on lines 66..81
            tests/Supports/ResultReaderTest.php on lines 88..103
            tests/Supports/ResultReaderTest.php on lines 132..147
            tests/Supports/ResultReaderTest.php on lines 154..169
            tests/Supports/ResultReaderTest.php on lines 176..191
            tests/Supports/ResultReaderTest.php on lines 198..213
            tests/Supports/ResultReaderTest.php on lines 220..235

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

            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 9 locations. Consider refactoring.
            Open

                public function testCallYslowResultReader()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 9)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 44..59
            tests/Supports/ResultReaderTest.php on lines 66..81
            tests/Supports/ResultReaderTest.php on lines 88..103
            tests/Supports/ResultReaderTest.php on lines 110..125
            tests/Supports/ResultReaderTest.php on lines 132..147
            tests/Supports/ResultReaderTest.php on lines 154..169
            tests/Supports/ResultReaderTest.php on lines 176..191
            tests/Supports/ResultReaderTest.php on lines 198..213

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

            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 9 locations. Consider refactoring.
            Open

                public function testCallSocialMediaResultReader()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 6)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 44..59
            tests/Supports/ResultReaderTest.php on lines 66..81
            tests/Supports/ResultReaderTest.php on lines 88..103
            tests/Supports/ResultReaderTest.php on lines 110..125
            tests/Supports/ResultReaderTest.php on lines 132..147
            tests/Supports/ResultReaderTest.php on lines 176..191
            tests/Supports/ResultReaderTest.php on lines 198..213
            tests/Supports/ResultReaderTest.php on lines 220..235

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

            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 9 locations. Consider refactoring.
            Open

                public function testCallPagespeedResultReaderForDesktop()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 7)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 44..59
            tests/Supports/ResultReaderTest.php on lines 66..81
            tests/Supports/ResultReaderTest.php on lines 88..103
            tests/Supports/ResultReaderTest.php on lines 110..125
            tests/Supports/ResultReaderTest.php on lines 132..147
            tests/Supports/ResultReaderTest.php on lines 154..169
            tests/Supports/ResultReaderTest.php on lines 198..213
            tests/Supports/ResultReaderTest.php on lines 220..235

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

            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 9 locations. Consider refactoring.
            Open

                public function testCallSeoResultReaderForBackendSeo()
                {
                    $jobFaker = factory(JobInspect::class)->create([
                        'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                        'scope_id' => Scope::where('id', 2)->first()->id
            Severity: Major
            Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
            tests/Supports/ResultReaderTest.php on lines 44..59
            tests/Supports/ResultReaderTest.php on lines 88..103
            tests/Supports/ResultReaderTest.php on lines 110..125
            tests/Supports/ResultReaderTest.php on lines 132..147
            tests/Supports/ResultReaderTest.php on lines 154..169
            tests/Supports/ResultReaderTest.php on lines 176..191
            tests/Supports/ResultReaderTest.php on lines 198..213
            tests/Supports/ResultReaderTest.php on lines 220..235

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

            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

                public function testGetPatterns()
                {
                    $decoder = Mockery::mock(JsonDecoder::class);
                    $issue = Mockery::mock(Issue::class);
                    $reader = new ResultReader($decoder, $issue);
            Severity: Minor
            Found in tests/Supports/ResultReaderTest.php and 1 other location - About 30 mins to fix
            tests/Supports/ResultReaderTest.php on lines 717..725

            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

                public function testGetPagespeedErrorType()
                {
                    $decoder = Mockery::mock(JsonDecoder::class);
                    $issue = Mockery::mock(Issue::class);
                    $reader = new ResultReader($decoder, $issue);
            Severity: Minor
            Found in tests/Supports/ResultReaderTest.php and 1 other location - About 30 mins to fix
            tests/Supports/ResultReaderTest.php on lines 669..677

            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

            There are no issues that match your filters.

            Category
            Status