Oefenweb/cakephp-redis

View on GitHub

Showing 13 of 13 total issues

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

    public function testSuccessfulSetPrefix() {
        // Get mock, without the constructor being called
        $Source = $this->getMockBuilder('TestRedisSource')->disableOriginalConstructor()->getMock();

        $prefix = 'foo';
Severity: Major
Found in Test/Case/Model/Datasource/RedisSourceTest.php and 1 other location - About 4 hrs to fix
Test/Case/Model/Datasource/RedisSourceTest.php on lines 621..640

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

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 testFailingSetPrefix() {
        // Get mock, without the constructor being called
        $Source = $this->getMockBuilder('TestRedisSource')->disableOriginalConstructor()->getMock();

        $prefix = 'foo';
Severity: Major
Found in Test/Case/Model/Datasource/RedisSourceTest.php and 1 other location - About 4 hrs to fix
Test/Case/Model/Datasource/RedisSourceTest.php on lines 595..614

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

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

    public function testSuccessfulAuthenticate() {
        // Get mock, without the constructor being called
        $Source = $this->getMockBuilder('TestRedisSource')->disableOriginalConstructor()->getMock();

        $password = 'foo';
Severity: Major
Found in Test/Case/Model/Datasource/RedisSourceTest.php and 3 other locations - About 4 hrs to fix
Test/Case/Model/Datasource/RedisSourceTest.php on lines 467..486
Test/Case/Model/Datasource/RedisSourceTest.php on lines 518..537
Test/Case/Model/Datasource/RedisSourceTest.php on lines 544..563

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

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

    public function testSuccessfulSelect() {
        // Get mock, without the constructor being called
        $Source = $this->getMockBuilder('TestRedisSource')->disableOriginalConstructor()->getMock();

        $database = 'foo';
Severity: Major
Found in Test/Case/Model/Datasource/RedisSourceTest.php and 3 other locations - About 4 hrs to fix
Test/Case/Model/Datasource/RedisSourceTest.php on lines 441..460
Test/Case/Model/Datasource/RedisSourceTest.php on lines 467..486
Test/Case/Model/Datasource/RedisSourceTest.php on lines 544..563

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

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

    public function testFailingAuthenticate() {
        // Get mock, without the constructor being called
        $Source = $this->getMockBuilder('TestRedisSource')->disableOriginalConstructor()->getMock();

        $password = 'foo';
Severity: Major
Found in Test/Case/Model/Datasource/RedisSourceTest.php and 3 other locations - About 4 hrs to fix
Test/Case/Model/Datasource/RedisSourceTest.php on lines 441..460
Test/Case/Model/Datasource/RedisSourceTest.php on lines 518..537
Test/Case/Model/Datasource/RedisSourceTest.php on lines 544..563

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

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

    public function testFailingSelect() {
        // Get mock, without the constructor being called
        $Source = $this->getMockBuilder('TestRedisSource')->disableOriginalConstructor()->getMock();

        $database = 'foo';
Severity: Major
Found in Test/Case/Model/Datasource/RedisSourceTest.php and 3 other locations - About 4 hrs to fix
Test/Case/Model/Datasource/RedisSourceTest.php on lines 441..460
Test/Case/Model/Datasource/RedisSourceTest.php on lines 467..486
Test/Case/Model/Datasource/RedisSourceTest.php on lines 518..537

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

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 RedisSourceTest.php has 307 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
App::uses('RedisSource', 'Redis.Model/Datasource');

/**
 * Test Redis Source class
Severity: Minor
Found in Test/Case/Model/Datasource/RedisSourceTest.php - About 3 hrs to fix

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

    class RedisSourceTest extends CakeTestCase {
    
    /**
     * setUp method
     *
    Severity: Minor
    Found in Test/Case/Model/Datasource/RedisSourceTest.php - About 3 hrs to fix

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

          public function testNoSetPrefix() {
              // Get mock, without the constructor being called
              $Source = $this->getMockBuilder('TestRedisSource')->disableOriginalConstructor()->getMock();
      
              $prefix = '';
      Severity: Major
      Found in Test/Case/Model/Datasource/RedisSourceTest.php and 2 other locations - About 2 hrs to fix
      Test/Case/Model/Datasource/RedisSourceTest.php on lines 416..434
      Test/Case/Model/Datasource/RedisSourceTest.php on lines 493..511

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

      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 testNoSelect() {
              // Get mock, without the constructor being called
              $Source = $this->getMockBuilder('TestRedisSource')->disableOriginalConstructor()->getMock();
      
              $database = '';
      Severity: Major
      Found in Test/Case/Model/Datasource/RedisSourceTest.php and 2 other locations - About 2 hrs to fix
      Test/Case/Model/Datasource/RedisSourceTest.php on lines 416..434
      Test/Case/Model/Datasource/RedisSourceTest.php on lines 570..588

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

      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 testNoAuthenticate() {
              // Get mock, without the constructor being called
              $Source = $this->getMockBuilder('TestRedisSource')->disableOriginalConstructor()->getMock();
      
              $password = '';
      Severity: Major
      Found in Test/Case/Model/Datasource/RedisSourceTest.php and 2 other locations - About 2 hrs to fix
      Test/Case/Model/Datasource/RedisSourceTest.php on lines 493..511
      Test/Case/Model/Datasource/RedisSourceTest.php on lines 570..588

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

      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 testCloseConnected() {
              $Source = new TestRedisSource();
      
              $Source->connected = true;
              $Source->_connection = $this->getMock('Redis', ['close']);
      Severity: Major
      Found in Test/Case/Model/Datasource/RedisSourceTest.php and 1 other location - About 1 hr to fix
      Test/Case/Model/Datasource/RedisSourceTest.php on lines 642..656

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

      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 testCloseNotConnected() {
              $Source = new TestRedisSource();
      
              $Source->connected = false;
              $Source->_connection = $this->getMock('Redis', ['close']);
      Severity: Major
      Found in Test/Case/Model/Datasource/RedisSourceTest.php and 1 other location - About 1 hr to fix
      Test/Case/Model/Datasource/RedisSourceTest.php on lines 658..672

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

      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

      Severity
      Category
      Status
      Source
      Language