Code should not be duplicated

More information: https://insight.symfony.com/what-we-analyse/php.duplicated_code

  1. public function render(Chart $chart)
  2. {
  3. // make it a line chart
  4. $chartOptions = $chart->getOptionsType('chart', new Container('chart'));
  5. $chartOptions->setType('column');
  6. $chart->addOptions($chartOptions);

    The next 31 lines appear both in classes/Phighchart/Renderer/Column.php:28 and classes/Phighchart/Renderer/Line.php:28.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Alex Regenbogen
  7. // prepare the data
  8. $series = array();
  9. //formatter for rendering this chart

PHPUnit should be able to run all PHP tests 9

More information: https://insight.symfony.com/what-we-analyse/php.neglected_tests

This file is not included in any of the tests suites present in the source code (phpunit.xml).

Time to fix: about 1 hour
Open Issue Permalink
Collective

This file is not included in any of the tests suites present in the source code (phpunit.xml).

Time to fix: about 1 hour
Open Issue Permalink
Collective

This file is not included in any of the tests suites present in the source code (phpunit.xml).

Time to fix: about 1 hour
Open Issue Permalink
Collective

This file is not included in any of the tests suites present in the source code (phpunit.xml).

Time to fix: about 1 hour
Open Issue Permalink
Collective

This file is not included in any of the tests suites present in the source code (phpunit.xml).

Time to fix: about 1 hour
Open Issue Permalink
Last edited by Chris Sedlmayr

This file is not included in any of the tests suites present in the source code (phpunit.xml).

Time to fix: about 1 hour
Open Issue Permalink
Collective

This file is not included in any of the tests suites present in the source code (phpunit.xml).

Time to fix: about 1 hour
Open Issue Permalink
Last edited by shahrukhomar

This file is not included in any of the tests suites present in the source code (phpunit.xml).

Time to fix: about 1 hour
Open Issue Permalink
Collective

This file is not included in any of the tests suites present in the source code (phpunit.xml).

Time to fix: about 1 hour
Open Issue Permalink
Collective

Deprecated class usage found

More information: https://insight.symfony.com/what-we-analyse/third_party.use_deprecated_class

in poc/Examples.php, line 6
  1. <?php
  2. require_once '/home/sites/phighcharts/poc/UniversalClassLoader.php';
  3. use Symfony\Component\ClassLoader\UniversalClassLoader;
  4. $loader = new UniversalClassLoader();

    The Symfony\Component\ClassLoader\UniversalClassLoader class has been deprecated in Symfony 2.7. Use the Symfony\Component\ClassLoader\ClassLoader class instead.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by catchamonkey
  5. $loader->register();
  6. $loader->registerNamespaces(array(
  7. 'Phighchart' => __DIR__.'/../classes'
  8. ));

Text files should end with a valid new line character. 2

More information: https://insight.symfony.com/what-we-analyse/missing_e_o_l

in composer.json, line 24
  1. "autoload": {
  2. "psr-0": {
  3. "Phighchart": "classes"
  4. }
  5. }
  6. }

    This file ends with no newline character, or with a different newline character than other files in your project. It won't render properly on a terminal, and it's considered a bad practice.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Chris Sedlmayr
in LICENSE, line 19
  1. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6. THE SOFTWARE.

    This file ends with no newline character, or with a different newline character than other files in your project. It won't render properly on a terminal, and it's considered a bad practice.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Chris Sedlmayr

PHP code should follow PSR-1 basic coding standard 2

More information: https://insight.symfony.com/what-we-analyse/php.psr1

  1. * @link http://no2.php.net/manual/en/datetime.formats.date.php
  2. * @throws InvalidArgumentException If string format cannot be parsed
  3. * @param String $stringDate Datetime string to convert
  4. * @return String
  5. */
  6. private function _convertStringToJsDate($stringDate)

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by shahrukhomar
  7. {
  8. $date = false;
  9. //if custom date format has been defined by the user, use it to
  10. //translate date string into PHP DateTime object
  11. if (
  1. * @param string $key Key to get the sticky colour for
  2. * @return bool FALSE if extended options not set or the sticky colour not
  3. * found string sticky colour if found for the given key
  4. * @author Shahrukh Omar <shahrukhomar@gmail.com>
  5. */
  6. protected function _getStickyColour(Chart $chart, $key)

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by shahrukhomar
  7. {
  8. //return False if the extended options are not set
  9. if (!$chart->getExtendedOptions()) {
  10. return FALSE;
  11. }