Code Monkey home page Code Monkey logo

admincrudbundle's People

Contributors

camuschino avatar gonzaloalonsod avatar maxshtefec avatar skywalker0088 avatar soyfelixbarros avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

admincrudbundle's Issues

[Insight] Missing use statement should be avoided - in Controller/BackendController.php, line 60

in Controller/BackendController.php, line 60

The Exception class resolves to the following classes: Imagine\Exception\Exception or Symfony\Component\Config\Definition\Exception\Exception or Ivory\CKEditorBundle\Exception\Exception.
Did you forget to add a corresponding use statement for one of them?

                    }

                    $em->flush();

                    $res = true;
                } catch (Exception $e) {
                    $res = false;
                }
            } else {
                $res = false;
            }

Posted from SensioLabsInsight

[Insight] Commented code should not be committed - in Command/MWSimpleCrudCommand.php, line 115

in Command/MWSimpleCrudCommand.php, line 115

Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

        $withWrite = $input->getOption('with-write') ?: true;
        $output->writeln(array(
            '',
            'By default, the generator creates actions: list, show, new, update, and delete.',
        ));
        // $withWrite = $dialog->askConfirmation($output, $dialog->getQuestion('Do you want to generate the "write" actions', $withWrite ? 'yes' : 'no', '?'), $withWrite);
        $input->setOption('with-write', true);

        // format
        $format = $input->getOption('format');
        $output->writeln(array(

Posted from SensioLabsInsight

[Insight] Unused use statement should be avoided - in Controller/BackEndController.php, line 6

in Controller/BackEndController.php, line 6

The class Symfony\Component\Yaml\Yaml is declared but never used. You should remove the use statement.

<?php

namespace MWSimple\Bundle\AdminCrudBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Yaml\Yaml;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

/**

Posted from SensioLabsInsight

[Insight] Absolute path constants __DIR__ and __FILE__ should not be used - in Command/MWSimpleCrudCommand.php, line 63

in Command/MWSimpleCrudCommand.php, line 63

__DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

        if (is_dir($dir = $this->getContainer()->get('kernel')->getRootdir().'/Resources/SensioGeneratorBundle/skeleton')) {
            $skeletonDirs[] = $dir;
        }

        $skeletonDirs[] = __DIR__.'/../Resources/skeleton';
        $skeletonDirs[] = __DIR__.'/../Resources';

        return $skeletonDirs;
    }

Posted from SensioLabsInsight

[Insight] Boolean should be compared strictly - in Form/…/BootstrapDateTimeTransformer.php, line 79

USAR IS_NULL
in Form/DataTransformer/BootstrapDateTimeTransformer.php, line 79

With booleans, only strict comparison (with === operator) should be used to lower bug risks and to improve performances.

    {
        if (! ($value instanceof \DateTime)) {
            return $value;
        }

        if (null == $value) {
            return null;
        }

        if ($this->widgetType == 'date') {
            $value = new \DateTime($value->format('Y-m-d'));

Posted from SensioLabsInsight

FIX save name file

Al guardar la imagen utiliza el nombre del archivo si subo 2 igual nombre archivo lo pisa arriba. Guardar el nombre de archivo de otra manera

[Insight] Code should not be duplicated - in Generator/MWSimpleCrudGenerator.php, line 217

in Generator/MWSimpleCrudGenerator.php, line 217

The next 24 lines appear both in Generator/MWSimpleCrudGenerator.php:217 and Generator/MWSimpleFormGenerator.php:103.

     * Fields can be both column fields and association fields.
     *
     * @param ClassMetadataInfo $metadata
     * @return array $fields
     */
    private function getFieldsAssociationFromMetadata(ClassMetadataInfo $metadata)
    {
        $associations = array();
        foreach ($metadata->associationMappings as $value) {
            $parts = explode('\\', $value['targetEntity']);
            if (count($parts) === 3) {  

Posted from SensioLabsInsight

[Insight] Logical operators should be avoided - in Form/…/BootstrapDateTimeTransformer.php, line 87

in Form/DataTransformer/BootstrapDateTimeTransformer.php, line 87

The or operator does not have the same precedence as ||.
This could lead to unexpected behavior, use || instead.

        if ($this->widgetType == 'date') {
            $value = new \DateTime($value->format('Y-m-d'));
        }

        if ($this->widgetType == 'time' or $this->widgetType == 'day') {
            $value = new \DateTime('1970-01-01 ' . $value->format('H:i:s'));
        }

        return $value;
    }

Posted from SensioLabsInsight

[Insight] Files should not be executable

Your project contains files with permissive permissions. In order to avoid opening a security breach, you should restrict execution rights on following files:

  • Resources/views/Form/field_file.html.twig
  • Services/ACLManager.php
chmod a-x 'Resources/views/Form/field_file.html.twig' \
    'Services/ACLManager.php'

Posted from SensioLabsInsight

[Insight] Text files should end with a newline character - in Command/MWSimpleCrudCommand.php, line 148

Agregar a todos los archivos un espacio al final como buena practica
in Command/MWSimpleCrudCommand.php, line 148

This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

            sprintf('You are going to generate a CRUD controller for "<info>%s:%s</info>"', $bundle, $entity),
            sprintf('using the "<info>%s</info>" format.', $format),
            '',
        ));
    }
}

Posted from SensioLabsInsight

Fix Form Type

Al generar el crud el formulario duplica los campos de relaciones

KNP menu does not render anything

The line {{ knp_menu_render('MWSimpleAdminCrudBundle:Builder:adminMenu') }} in vendor/mwsimple/admin-crud/MWSimple/Bundle/AdminCrudBundle/Resources/views/layout.html.twig does not render anything. Did I miss some configuration entry?

[Insight] Unused method, property, variable or parameter - in Command/MWSimpleMenuCommand.php, line 37

in Command/MWSimpleMenuCommand.php, line 37

This url_min local variable is declared but never used. You should remove it.

    private function updateConfig(InputInterface $input, OutputInterface $output)
    {
        $name = $input->getArgument('name');
        $name_min = strtolower($name);
        $url = $input->getArgument('url');
        $url_min = strtolower($url);
        $configPath = $input->getArgument('config');

        $file = $this->getContainer()->getParameter('kernel.root_dir').'/../'.$configPath;
        // if the config.yml file doesn't exist, don't even try.
        if (!file_exists($file)) {

Posted from SensioLabsInsight

Agregar theme opcional

Se debe poder configurar el entre las opciones los siguientes temas:

  • Basic (seria el actual)
  • Gentelella

[Insight] Commented code should not be committed - in Generator/MWSimpleFormGenerator.php, line 97

in Generator/MWSimpleFormGenerator.php, line 97

Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

            $fields = array_diff($fields, $metadata->identifier);
        }
        // Comento porque retorno en generate associations utilizando mws_tecspro_comun
        // foreach ($metadata->associationMappings as $fieldName => $relation) {
        //     if ($relation['type'] !== ClassMetadataInfo::ONE_TO_MANY) {
        //         $fields[] = $fieldName;
        //     }
        // }

        return $fields;
    }

Posted from SensioLabsInsight

[Insight] Unused method, property, variable or parameter - in Command/MWSimpleCrudCommand.php, line 104

in Command/MWSimpleCrudCommand.php, line 104

This metadata local variable is declared but never used. You should remove it.

        $input->setOption('entity', $entity);
        list($bundle, $entity) = $this->parseShortcutNotation($entity);

        try {
            $entityClass = $this->getContainer()->get('doctrine')->getAliasNamespace($bundle).'\\'.$entity;
            $metadata = $this->getEntityMetadata($entityClass);
        } catch (\Exception $e) {
            throw new \RuntimeException(sprintf('Entity "%s" does not exist in the "%s" bundle. You may have mistyped the bundle name or maybe the entity doesn\'t exist yet (create it first with the "doctrine:generate:entity" command).', $entity, $bundle));
        }

        // write?

Posted from SensioLabsInsight

[Insight] Unused use statement should be avoided - in Command/MWSimpleMenuCommand.php, line 8

in Command/MWSimpleMenuCommand.php, line 8

The class Symfony\Component\Console\Input\InputOption is declared but never used. You should remove the use statement.

namespace MWSimple\Bundle\AdminCrudBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\Question;
use Symfony\Component\Yaml\Yaml;

class MWSimpleMenuCommand extends ContainerAwareCommand

Posted from SensioLabsInsight

[Insight] Unused use statement should be avoided - in Form/Listener/FilterSubscriber.php, line 7

in Form/Listener/FilterSubscriber.php, line 7

The class Symfony\Component\HttpFoundation\Request is declared but never used. You should remove the use statement.

namespace MWSimple\Bundle\AdminCrudBundle\Form\Listener;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Lexik\Bundle\FormFilterBundle\Event\GetFilterConditionEvent;
use Symfony\Component\HttpFoundation\Request;

class FilterSubscriber implements EventSubscriberInterface {

    /**
     * {@inheritDoc}

Posted from SensioLabsInsight

[Insight] Files should not be executable

Your project contains files with permissive permissions. In order to avoid opening a security breach, you should restrict execution rights on following files:

  • Resources/views/Form/field_file.html.twig
  • Services/ACLManager.php
chmod a-x 'Resources/views/Form/field_file.html.twig' \
    'Services/ACLManager.php'

Posted from SensioLabsInsight

[Insight] Object parameters should be type hinted - in Form/…/EntityToJsonOneTransformer.php, line 42

in Form/DataTransformer/EntityToJsonOneTransformer.php, line 42

The parameter entity, which is an object, should be typehinted.

            return null;
        };
        $jsonResponse = array();
        if (is_array($entities)) {
            if (array_key_exists(0, $entities)) {
                $jsonResponse = $entities->map(function ($entity) {
                    return array(
                        'id' => $entity->getId(),
                        'text' => $entity->__toString()
                    );
                })->toArray();

Posted from SensioLabsInsight

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.