PrivateBin/PrivateBin

View on GitHub

Showing 775 of 775 total issues

The class Controller has an overall complexity of 50 which is very high. The configured complexity threshold is 50.
Open

class Controller
{
    /**
     * version
     *
Severity: Minor
Found in lib/Controller.php by phpmd

The class BucketStub has 23 public methods. Consider refactoring BucketStub to keep number of public methods under 10.
Open

class BucketStub extends Bucket
{
    public $_objects;
    private $_name;
    private $_info;
Severity: Minor
Found in tst/Bootstrap.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class ControllerTest has 39 non-getter- and setter-methods. Consider refactoring ControllerTest to keep number of methods under 25.
Open

class ControllerTest extends TestCase
{
    protected $_data;

    protected $_path;
Severity: Minor
Found in tst/ControllerTest.php by phpmd

TooManyMethods

Since: 0.1

A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

The default was changed from 10 to 25 in PHPMD 2.3.

Example

Source https://phpmd.org/rules/codesize.html#toomanymethods

The class Filesystem has an overall complexity of 74 which is very high. The configured complexity threshold is 50.
Open

class Filesystem extends AbstractData
{
    /**
     * glob() pattern of the two folder levels and the paste files under the
     * configured path. Needs to return both files with and without .php suffix,
Severity: Minor
Found in lib/Data/Filesystem.php by phpmd

The class ConnectionInterfaceStub has 25 public methods. Consider refactoring ConnectionInterfaceStub to keep number of public methods under 10.
Open

class ConnectionInterfaceStub implements ConnectionInterface
{
    public function deleteAcl(array $args = array())
    {
        throw new BadMethodCallException('not supported by this stub');
Severity: Minor
Found in tst/Bootstrap.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class ConfigurationTest has 13 public methods. Consider refactoring ConfigurationTest to keep number of public methods under 10.
Open

class ConfigurationTest extends TestCase
{
    private $_minimalConfig;

    private $_options;
Severity: Minor
Found in tst/ConfigurationTest.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class I18nTest has 17 public methods. Consider refactoring I18nTest to keep number of public methods under 10.
Open

class I18nTest extends TestCase
{
    private $_translations = array();

    public function setUp(): void
Severity: Minor
Found in tst/I18nTest.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class ModelTest has 22 public methods. Consider refactoring ModelTest to keep number of public methods under 10.
Open

class ModelTest extends TestCase
{
    private $_conf;

    private $_model;
Severity: Minor
Found in tst/ModelTest.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class ControllerTest has 39 public methods. Consider refactoring ControllerTest to keep number of public methods under 10.
Open

class ControllerTest extends TestCase
{
    protected $_data;

    protected $_path;
Severity: Minor
Found in tst/ControllerTest.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class GoogleCloudStorage has an overall complexity of 66 which is very high. The configured complexity threshold is 50.
Open

class GoogleCloudStorage extends AbstractData
{
    /**
     * GCS client
     *
Severity: Minor
Found in lib/Data/GoogleCloudStorage.php by phpmd

The class I18n has an overall complexity of 115 which is very high. The configured complexity threshold is 50.
Open

class I18n
{
    /**
     * language
     *
Severity: Minor
Found in lib/I18n.php by phpmd

The class S3Storage has an overall complexity of 69 which is very high. The configured complexity threshold is 50.
Open

class S3Storage extends AbstractData
{
    /**
     * S3 client
     *
Severity: Minor
Found in lib/Data/S3Storage.php by phpmd

The class Request has an overall complexity of 61 which is very high. The configured complexity threshold is 50.
Open

class Request
{
    /**
     * MIME type for JSON
     *
Severity: Minor
Found in lib/Request.php by phpmd

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

    public static function setUpBeforeClass(): void
    {
        $httpClient = new Client(array('debug'=>false));
        $handler    = HttpHandlerFactory::build($httpClient);

Severity: Major
Found in tst/Data/GoogleCloudStorageTest.php and 1 other location - About 3 hrs to fix
tst/ControllerWithGcsTest.php on lines 17..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 142.

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

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

    public static function setUpBeforeClass(): void
    {
        $httpClient = new Client(array('debug'=>false));
        $handler    = HttpHandlerFactory::build($httpClient);

Severity: Major
Found in tst/ControllerWithGcsTest.php and 1 other location - About 3 hrs to fix
tst/Data/GoogleCloudStorageTest.php on lines 13..25

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

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 testBrowserLanguageCsDetection()
    {
        $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'cs;q=0.8,en-GB;q=0.6,en-US;q=0.4,en;q=0.2';
        I18n::loadTranslations();
        $this->assertEquals('cs', I18n::getLanguage(), 'browser language cs');
Severity: Major
Found in tst/I18nTest.php and 1 other location - About 2 hrs to fix
tst/I18nTest.php on lines 126..135

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

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 testBrowserLanguageRuDetection()
    {
        $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'ru;q=0.8,en-GB;q=0.6,en-US;q=0.4,en;q=0.2';
        I18n::loadTranslations();
        $this->assertEquals('ru', I18n::getLanguage(), 'browser language ru');
Severity: Major
Found in tst/I18nTest.php and 1 other location - About 2 hrs to fix
tst/I18nTest.php on lines 152..161

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

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

                        '{"iv":"WA42mdxIVXUwBqZu7JYNiw==","v":1,"iter":10000,"ks"' +
                        ':256,"ts":128,"mode":"gcm","adata":"","cipher":"aes","sa' +
                        'lt":"jN6CjbQMJCM=","ct":"kYYMo5DFG1+w0UHiYXT5pdV0IUuXxzO' +
                        'lslkW/c3DRCbGFROCVkAskHce7HoRczee1N9c5MhHjVMJUIZE02qIS8U' +
                        'yHdJ/GqcPVidTUcj9rnDNWsTXkjVv8jCwHS/cwmAjDTWpwp5ThECN+ov' +
Severity: Major
Found in js/test/CryptTool.js and 1 other location - About 2 hrs to fix
js/test/CryptTool.js on lines 53..74

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

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

                    '{"iv":"4HNFIl7eYbCh6HuShctTIA==","v":1,"iter":10000,"ks"' +
                    ':256,"ts":128,"mode":"gcm","adata":"","cipher":"aes","sa' +
                    'lt":"u0lQvePq6L0=","ct":"fGPUVrDyaVr1ZDGb+kqQ3CPEW8x4YKG' +
                    'fzHDmA0Vjkh250aWNe7Cnigkps9aaFVMX9AaerrTp3yZbojJtNqVGMfL' +
                    'dUTu+53xmZHqRKxCCqSfDNSNoW4Oxk5OVgAtRyuG4bXHDsWTXDNz2xce' +
Severity: Major
Found in js/test/CryptTool.js and 1 other location - About 2 hrs to fix
js/test/CryptTool.js on lines 84..105

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

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

        function changeBurnAfterReading()
        {
            if (me.getBurnAfterReading()) {
                $openDiscussionOption.addClass('buttondisabled');
                $openDiscussion.prop('checked', false);
Severity: Major
Found in js/privatebin.js and 1 other location - About 2 hrs to fix
js/privatebin.js on lines 3750..3761

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

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