tacnoman/dephpug

View on GitHub

Showing 21 of 22 total issues

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

<?php

namespace Dephpug\Exporter\Type;

use Dephpug\Exporter\iExporter;
Severity: Major
Found in src/Dephpug/Exporter/Type/ObjectExporter.php and 1 other location - About 2 hrs to fix
src/Dephpug/Exporter/Type/ArrayExporter.php on lines 1..32

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

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 Dephpug\Exporter\Type;

use Dephpug\Exporter\iExporter;
Severity: Major
Found in src/Dephpug/Exporter/Type/ArrayExporter.php and 1 other location - About 2 hrs to fix
src/Dephpug/Exporter/Type/ObjectExporter.php on lines 1..32

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

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

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 18 and the first side effect is on line 5.
Open

<?php
Severity: Minor
Found in src/Dephpug/Command.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 15 and the first side effect is on line 5.
Open

<?php
Severity: Minor
Found in src/Dephpug/MessageEvent.php by phpcodesniffer

Function execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $_, OutputInterface $output)
    {
        $output->write(splashScreen());
        while (true) {
            try {
Severity: Minor
Found in src/Dephpug/Console/DebuggerCommand.php - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Line exceeds 120 characters; contains 146 characters
Open

$phar->setStub("#!/usr/bin/env php\n<?php Phar::mapPhar('dephpugger.phar'); require 'phar://dephpugger.phar/bin/dephpugger'; __HALT_COMPILER();");
Severity: Minor
Found in create-phar.php by phpcodesniffer

Line exceeds 120 characters; contains 130 characters
Open

            'This command make the debugger run again until find a next breakpoint or finish the script (request or cli script).',

Line exceeds 120 characters; contains 152 characters
Open

 *  <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="0" status="break" reason="ok">

Line exceeds 120 characters; contains 421 characters
Open

 *  <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///path/of/index.php" language="PHP" xdebug:language_version="7.0.4-5ubuntu1" protocol_version="" appid=""><engine version=""><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2016 by Derick Rethans]]></copyright></init>

Line exceeds 120 characters; contains 122 characters
Open

<fg=blue>Obs: You don't need use echo or var_dump/print_r. Use only the variable or function to get the value exported.</>

Line exceeds 120 characters; contains 174 characters
Open

        $command = "{$configVar} {$phpPath} -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port={$debuggerPort} -dxdebug.remote_host=127.0.0.1 {$phpFile}";

Line exceeds 120 characters; contains 130 characters
Open

            'This command make the debugger run again until find a next breakpoint or finish the script (request or cli script).',

Line exceeds 120 characters; contains 165 characters
Open

 * <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="1" status="stopping" reason="ok"></response>

Line exceeds 120 characters; contains 230 characters
Open

 *  <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="5"><property name="$d" fullname="$d" type="float"><![CDATA[3.3333333333333]]></property></response>

Line exceeds 120 characters; contains 160 characters
Open

 * <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="1" status="break" reason="ok">

Line exceeds 120 characters; contains 126 characters
Open

        return 'This command ask if you want to close the debugger. The request/script will continue when the debugger stop.';

Line exceeds 120 characters; contains 137 characters
Open

            'The dephpugger convert commands to dbgp protocol format to make a developer\'s life easier (like `n` to `step_over -i 1`).',

Interface name "iExporter" is not in camel caps format
Open

interface iExporter

Interface name "iCore" is not in camel caps format
Open

interface iCore

Interface name "iCommand" is not in camel caps format
Open

interface iCommand
Severity
Category
Status
Source
Language