Code Monkey home page Code Monkey logo

metadiscourse-annotator's People

Contributors

dinel avatar

Watchers

 avatar

metadiscourse-annotator's Issues

[Insight] Unused method, property, variable or parameter - in src/…/Controller/DefaultController.php, line 18

in src/AppBundle/Controller/DefaultController.php, line 18

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

    /**
     * @Route("/", name="homepage")
     */
    public function indexAction(Request $request)
    {
        $texts = $this->getDoctrine()
                      ->getRepository('AppBundle:Text')
                       ->findAll();
        /*
        return $this->render('FrontPage/index.html.twig', array(
            'texts' => $texts,

Posted from SensioLabsInsight

[Insight] Website should be protected against XSSVulnerability - in app/…/Annotator/annotation.css.twig, line 11

in app/Resources/views/Annotator/annotation.css.twig, line 11

Using the |raw filter or the {% autoescape false %} block in a Twig template exposes users to Cross-Site Scripting (XSS) attacks

    font-size: 12px;
}

{% for sense in senses %}
    span.sense{{sense.id}} {
      background-color: {{ sense.bgcolor | raw}};
      color: {{ sense.fgcolor | raw}};
      border: dotted thin black;
      padding: 2px;
    }
{% endfor %}

Posted from SensioLabsInsight

[Insight] Symfony applications should not contain a config.php file - in web, line 0

in web

This config.php file should only be used to bootstrap a Symfony application. Before releasing to production, you should remove it, otherwise attackers could get valuable insight about your application.


web/
├── css/
├── font-awesome/
├── jquery/
├── js/
├── app.php
├── app_dev.php
├── apple-touch-icon.png
├── config.php
├── favicon.ico
├── robots.txt
└── test.html

Posted from SensioLabsInsight

[Insight] PHP code should follow PSR-1 basic coding standard - in src/AppBundle/Entity/Markable.php, line 61

in src/AppBundle/Entity/Markable.php, line 61

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

    protected $domains;
    
    /**
     * The constructor
     */
    public function _construct() {
        $this->senses = new \Doctrine\Common\Collections\ArrayCollection();
        $this->domains = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**

Posted from SensioLabsInsight

[Insight] Missing use statement should be avoided - in src/…/CategoryAdminController.php, line 68

in src/AppBundle/Controller/CategoryAdminController.php, line 68

The Category class resolves to the following class: AppBundle\Entity\Category.
Did you forget to add a corresponding use statement?

    /**
     * Creates a new category
     * @Route("/admin/category/add", name="admin_category_add")
     */
    public function addCategoryAction(Request $request) {
        $category = new Category();
        
        return $this->editCategory_intern($request, $category, false);
    }    
    
    /**

Posted from SensioLabsInsight

[Insight] PHP code should follow PSR-1 basic coding standard - in src/…/CategoryAdminController.php, line 99

in src/AppBundle/Controller/CategoryAdminController.php, line 99

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

     * @param Request $request the request
     * @param Category $category an object Category that will be edited
     * @param bool $editing true if it edits an existing category
     * @return type
     */
    private function editCategory_intern($request, $category, $editing) {
        $form = $this->createForm(new CategoryType(), $category);
        
        $form->handleRequest($request);
        
        if($form->isValid()) {

Posted from SensioLabsInsight

[Insight] Website should be protected against XSSVulnerability - in app/…/Search/search_term.html.twig, line 28

in app/Resources/views/Search/search_term.html.twig, line 28

Using the |raw filter or the {% autoescape false %} block in a Twig template exposes users to Cross-Site Scripting (XSS) attacks

            </div></div><div id="results" class="row voffset3"><div class="col-md-8 col-md-offset-2"><h3>The search results for {{ message | raw }}</h3></div><div class="voffset3 text-center">
                {% if stats_for == "category" %}
                    {{ render_hinclude(controller(

Posted from SensioLabsInsight

[Insight] Website should be protected against XSSVulnerability - in app/…/Search/search_term_intern.html.twig, line 16

in app/Resources/views/Search/search_term_intern.html.twig, line 16

Using the |raw filter or the {% autoescape false %} block in a Twig template exposes users to Cross-Site Scripting (XSS) attacks

{% block body %}
    <div class="container"><div class="row voffset3"><div class="col-md-8 col-md-offset-2"><div><div><i>The statistics and annotation are from {{ search_scope|raw }}</i></div><h4>Statistics</h4><table class="table table-hover"><tr><td>Show</td><td>User</td>

Posted from SensioLabsInsight

[Insight] Website should be protected against XSSVulnerability - in app/…/Annotator/annotation.css.twig, line 12

in app/Resources/views/Annotator/annotation.css.twig, line 12

Using the |raw filter or the {% autoescape false %} block in a Twig template exposes users to Cross-Site Scripting (XSS) attacks

}

{% for sense in senses %}
    span.sense{{sense.id}} {
      background-color: {{ sense.bgcolor | raw}};
      color: {{ sense.fgcolor | raw}};
      border: dotted thin black;
      padding: 2px;
    }
{% endfor %}

Posted from SensioLabsInsight

Create a way to initialise the deployment

Currently the program make several assumptions about the state of the database. Create an action that makes all the necessary initialisation.

  • insert "No parent category" category

[Insight] Public methods in controller classes should only be actions (with the &lt;code&gt;Action&lt;/code&gt; suffix) - in src/…/Controller/AdminController.php, line 284

in src/AppBundle/Controller/AdminController.php, line 284

Non-action public method found in controller class

    }
    
    /**
     * @Route("/admin/corpus/category/{corpus_id}/{value_id}")
     */
    public function editCorpusCategory(\Symfony\Component\HttpFoundation\Request $request, 
            $corpus_id, $value_id) {
        if($request->isXmlHttpRequest()) {
            $em = $this->getDoctrine()->getManager();
            
            $value = $this->getDoctrine()

Posted from SensioLabsInsight

[Insight] The EntityManager should not be flushed within a loop - in src/…/Controller/AdminController.php, line 134

in src/AppBundle/Controller/AdminController.php, line 134

Calling flush is a resource intensive operation, especially when a lot of entities are managed by Doctrine. You should pass the entity you want to flush as parameter, or avoid flushing inside a loop.

                        ->getRepository('AppBundle:Domain')
                        ->findBy(array('name' => $name));
                    if(count($domain_name) == 0) {
                        $em = $this->getDoctrine()->getManager();
                        $em->persist($domain);
                        $em->flush();                        
                    }                                        
                } else {
                    break;
                }                
            }

Posted from SensioLabsInsight

[Insight] The EntityManager should not be flushed within a loop - in src/…/Controller/AdminController.php, line 134

in src/AppBundle/Controller/AdminController.php, line 134

Calling flush is a resource intensive operation, especially when a lot of entities are managed by Doctrine. You should pass the entity you want to flush as parameter, or avoid flushing inside a loop.

                        ->getRepository('AppBundle:Domain')
                        ->findBy(array('name' => $name));
                    if(count($domain_name) == 0) {
                        $em = $this->getDoctrine()->getManager();
                        $em->persist($domain);
                        $em->flush();                        
                    }                                        
                } else {
                    break;
                }                
            }

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.