<commit_before><?php

class CQuiroz_Indexer_Block_Adminhtml_Indexer_Grid extends Mage_Adminhtml_Block_Widget_Grid
{

    /**  @var string */
    protected $_massactionBlockName = 'cquiroz_indexer/adminhtml_indexer_grid_massaction';

    /**
     * @author <NAME> <<EMAIL>>
     */
    public function __construct()
    {
        parent::__construct();
        $this->setId('qdev_indexer_processes_grid');
        $this->_filterVisibility = false;
        $this->_pagerVisibility = false;
    }

    /**
     * @return CQuiroz_Indexer_Block_Adminhtml_Indexer_Grid
     * @author <NAME> <<EMAIL>>
     */
    protected function _prepareCollection()
    {
        $collection = Mage::getModel('cquiroz_indexer/indexer')->getIndexProcessCollection();
        $this->setCollection($collection);

        return parent::_prepareCollection();
    }

    /**
     * Add name and description to collection elements
     * @return CQuiroz_Indexer_Block_Adminhtml_Indexer_Grid
     * @author <NAME> <<EMAIL>>
     */
    protected function _afterLoadCollection()
    {
        /** @var $item Mage_Index_Model_Process */
        foreach ($this->_collection as $key => $item) {
            if (!$item->getIndexer()->isVisible()) {
                $this->_collection->removeItemByKey($key);
                continue;
            }
            $item->setName($item->getIndexer()->getName());
            $item->setDescription($item->getIndexer()->getDescription());
        }

        return parent::_afterLoadCollection();
    }

    /**
     * Prepare grid columns
     * @return CQuiroz_Indexer_Block_Adminhtml_Indexer_Grid
     * @author <NAME> <<EMAIL>>
     */
    protected function _prepareColumns()
    {
        $this->addColumn(
            'indexer_code',
            array(
                'header'   => Mage::helper('index')->__('Index'),
                'width'    => '180',
                'align'    => 'left',
                'index'    => 'name',
                'sortable' => false,
            )
        );

        $this->addColumn(
            'description',
            array(
                'header'   => Mage::helper('index')->__('Description'),
                'align'    => 'left',
                'index'    => 'description',
                'sortable' => false,
            )
        );

        $this->addColumn('action',
            array(
                'header'    => Mage::helper('index')->__('Action'),
                'width'     => '100',
                'type'      => 'action',
                'getter'    => 'getIndexerCode',
                'actions'   => array(
                    array(
                        'caption' => Mage::helper('index')->__('Reindex Now'),
                        'url'     => array('base' => '*/*/reindex'),
                        'field'   => 'indexer_code'
                    ),
                ),
                'filter'    => false,
                'sortable'  => false,
                'is_system' => true,
            )
        );

        return parent::_prepareColumns();
    }


    /**
     * @param mixed $row
     * @return null
     * @author <NAME> <<EMAIL>>
     */
    public function getRowUrl($row)
    {
        return null;
    }

    /**
     * Add mass actions to grid
     * @return CQuiroz_Indexer_Block_Adminhtml_Indexer_Grid
     * @author <NAME> <<EMAIL>>
     */
    protected function _prepareMassaction()
    {
        $this->setMassactionIdField('qdev_indexer_id');
        $this->getMassactionBlock()->setFormFieldName('indexer_code');

        $this->getMassactionBlock()->addItem(
            'reindex',
            array(
                'label'    => Mage::helper('index')->__('Reindex Now'),
                'url'      => $this->getUrl('*/*/reindex'),
                'selected' => true,
            )
        );

        return $this;
    }
}
<commit_msg>Disabled massaction, buggy.<commit_after><?php

class CQuiroz_Indexer_Block_Adminhtml_Indexer_Grid extends Mage_Adminhtml_Block_Widget_Grid
{

    /**  @var string */
    protected $_massactionBlockName = 'cquiroz_indexer/adminhtml_indexer_grid_massaction';

    /**
     * @author <NAME> <<EMAIL>>
     */
    public function __construct()
    {
        parent::__construct();
        $this->setId('qdev_indexer_processes_grid');
        $this->_filterVisibility = false;
        $this->_pagerVisibility = false;
    }

    /**
     * @return CQuiroz_Indexer_Block_Adminhtml_Indexer_Grid
     * @author <NAME> <<EMAIL>>
     */
    protected function _prepareCollection()
    {
        $collection = Mage::getModel('cquiroz_indexer/indexer')->getIndexProcessCollection();
        $this->setCollection($collection);

        return parent::_prepareCollection();
    }

    /**
     * Add name and description to collection elements
     * @return CQuiroz_Indexer_Block_Adminhtml_Indexer_Grid
     * @author <NAME> <<EMAIL>>
     */
    protected function _afterLoadCollection()
    {
        /** @var $item Mage_Index_Model_Process */
        foreach ($this->_collection as $key => $item) {
            if (!$item->getIndexer()->isVisible()) {
                $this->_collection->removeItemByKey($key);
                continue;
            }
            $item->setName($item->getIndexer()->getName());
            $item->setDescription($item->getIndexer()->getDescription());
        }

        return parent::_afterLoadCollection();
    }

    /**
     * Prepare grid columns
     * @return CQuiroz_Indexer_Block_Adminhtml_Indexer_Grid
     * @author <NAME> <<EMAIL>>
     */
    protected function _prepareColumns()
    {
        $this->addColumn(
            'indexer_code',
            array(
                'header'   => Mage::helper('index')->__('Index'),
                'width'    => '180',
                'align'    => 'left',
                'index'    => 'name',
                'sortable' => false,
            )
        );

        $this->addColumn(
            'description',
            array(
                'header'   => Mage::helper('index')->__('Description'),
                'align'    => 'left',
                'index'    => 'description',
                'sortable' => false,
            )
        );

        $this->addColumn('action',
            array(
                'header'    => Mage::helper('index')->__('Action'),
                'width'     => '100',
                'type'      => 'action',
                'getter'    => 'getIndexerCode',
                'actions'   => array(
                    array(
                        'caption' => Mage::helper('index')->__('Reindex Now'),
                        'url'     => array('base' => '*/*/reindex'),
                        'field'   => 'indexer_code'
                    ),
                ),
                'filter'    => false,
                'sortable'  => false,
                'is_system' => true,
            )
        );

        return parent::_prepareColumns();
    }


    /**
     * @param mixed $row
     * @return null
     * @author <NAME> <<EMAIL>>
     */
    public function getRowUrl($row)
    {
        return null;
    }

    /**
     * Add mass actions to grid
     * @return CQuiroz_Indexer_Block_Adminhtml_Indexer_Grid
     * @author <NAME> <<EMAIL>>
     */
    protected function _prepareMassaction_disabled()
    {
        $this->setMassactionIdField('qdev_indexer_id');
        $this->getMassactionBlock()->setFormFieldName('indexer_code');

        $this->getMassactionBlock()->addItem(
            'reindex',
            array(
                'label'    => Mage::helper('index')->__('Reindex Now'),
                'url'      => $this->getUrl('*/*/reindex'),
                'selected' => true,
            )
        );

        return $this;
    }
}

{'fraction_non_alphanumeric': 0.14509246088193456, 'fraction_numerical': 0.001551791025475236, 'mean_word_length': 1.67797783933518, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 149, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5831950', 'n_tokens_mistral': 2230, 'n_tokens_neox': 2129, 'n_words': 342}