open-orchestra/open-orchestra-media-admin-bundle

View on GitHub

Showing 67 of 89 total issues

Function _setupCrop has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _setupCrop(event) {
        event.preventDefault();

        this._destroyCropApi();
        this._hideOverrideTool();

Method setUp has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setUp()
    {
        $this->site1 = Phake::mock('OpenOrchestra\ModelInterface\Model\SiteInterface');
        Phake::when($this->site1)->getSiteId()->thenReturn($this->siteId1);
        Phake::when($this->site1)->getName()->thenReturn($this->siteName1);
Severity: Minor
Found in MediaAdminBundle/Tests/Form/Type/SiteForFolderChoiceTypeTest.php - About 1 hr to fix

Function listMedia has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    listMedia(page) {
        if (null === page) {
            page = 1
        }
        this._displayLoader(Application.getRegion('content'));

Function filterMedia has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    filterMedia(folderId) {
        this._displayLoader(Application.getRegion('content'));
        new Medias().fetch({
            urlParameter: {
                siteId: Application.getContext().get('siteId')

Method getNotSupportedSubjects has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function getNotSupportedSubjects()
    {
        $node = $this->createPhakeNode();
        $content = $this->createPhakeContent();
        $trashItem = $this->createPhakeTrashItem();

Method setUp has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setUp()
    {
        $this->tmpDir = __DIR__ . '/../../Fixtures/Source';
        $this->fullMedia = Phake::mock('OpenOrchestra\Media\Model\MediaInterface');
        Phake::when($this->fullMedia)->getFilesystemName()->thenReturn($this->fullMediaFileSystemName);

Function init has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    init(editor) {
        editor.addButton('media', {
            icon         : 'media',
            tooltip      : 'Insert media',
            stateSelector: 'img.tinymce-media',

Method getNotSupportedSubjects has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function getNotSupportedSubjects()
    {
        $node = $this->createPhakeNode();
        $content = $this->createPhakeContent();
        $trashItem = $this->createPhakeTrashItem();

Method getNotSupportedSubjects has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function getNotSupportedSubjects()
    {
        $node = $this->createPhakeNode();
        $content = $this->createPhakeContent();
        $trashItem = $this->createPhakeTrashItem();
Severity: Minor
Found in MediaAdmin/Tests/Security/Authorization/Voter/MediaVoterTest.php - About 1 hr to fix

Method testConfigureOptions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testConfigureOptions()
    {
        $resolverMock = Phake::mock('Symfony\Component\OptionsResolver\OptionsResolver');

        $this->form->configureOptions($resolverMock);
Severity: Minor
Found in MediaAdminBundle/Tests/Form/Type/MediaImageTypeTest.php - About 1 hr to fix

Method updateBlockConfiguration has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function updateBlockConfiguration(ContainerBuilder $container)
    {
        $mediaBlockConfiguration = array(
            GalleryStrategy::NAME => array(
                'category' => 'open_orchestra_backoffice.block_configuration.category.media',

Method testGetPerimeterConfiguration has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testGetPerimeterConfiguration()
    {
        $result = $this->strategy->getPerimeterConfiguration('siteId');
        $this->assertEquals(array (
            array (

Method testPreSetData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testPreSetData($findSite, $expectedAddCount)
    {
        $fakeSiteId = 'fakeSiteId';
        $fakeSiteName = 'fakeSiteName';

Method transformSubTree has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function transformSubTree(array $folder)
    {
        $rootFolder = $folder['folder'];

        $folderFacade = $this->newFolderFacade();
Severity: Minor
Found in MediaAdminBundle/Transformer/FolderTreeTransformer.php - About 1 hr to fix

Method provideFolder has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function provideFolder()
    {
        $mediaRepository = Phake::mock('OpenOrchestra\Media\Repository\MediaRepositoryInterface');

        $subfolder0 = Phake::mock('OpenOrchestra\Media\Model\MediaFolderInterface');
Severity: Minor
Found in MediaAdminBundle/Tests/Manager/FolderManagerTest.php - About 1 hr to fix

Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $tmpDir,
        MediaStorageManagerInterface $mediaStorageManager,
        array $allowedMimeTypes,
        ObjectManager $objectManager,
        FolderRepositoryInterface $folderRepository,
Severity: Major
Found in MediaAdminBundle/Manager/SaveMediaManager.php - About 1 hr to fix

Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $facadeClass,
        FileAlternativesManager $fileAlternativesManager,
        MultiLanguagesChoiceManagerInterface $multiLanguageChoiceManager,
        MediaStorageManagerInterface $mediaStorageManager,
        AuthorizationCheckerInterface $authorizationChecker,
Severity: Major
Found in MediaAdminBundle/Transformer/MediaTransformer.php - About 50 mins to fix

Method testConfig has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $file,
        $tmpDir,
        array $alternatives,
        array $thumbnail,
        $default,

Method testTransform has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function testTransform($folderId, $names, $parent, $siteId, $expectedParentId, $expectedName)
Severity: Minor
Found in MediaAdminBundle/Tests/Transformer/FolderTransformerTest.php - About 45 mins to fix

Method testCropAndResize has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function testCropAndResize($x, $y, $h, $w, $formatName, $expectedFileName)
Severity: Minor
Found in MediaAdmin/Tests/FileUtils/Image/ImagickImageManagerTest.php - About 45 mins to fix
Severity
Category
Status
Source
Language