GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 23c71a...dcb9a9 )
by Richard
11:04
created

LoadSongsCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 6
dl 25
loc 25
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 12 12 1
A execute() 9 9 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: wechsler
5
 * Date: 11/02/2017
6
 * Time: 20:19
7
 */
8
9
namespace Phase\TakeATicketBundle\Command;
10
11
use Phase\TakeATicket\SongLoader;
12
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
13
use Symfony\Component\Console\Input\InputArgument;
14
use Symfony\Component\Console\Input\InputInterface;
15
use Symfony\Component\Console\Output\OutputInterface;
16
17 View Code Duplication
class LoadSongsCommand extends ContainerAwareCommand
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
{
19
    protected function configure()
20
    {
21
        $this
22
            // the name of the command (the part after "bin/console")
23
            ->setName('ticket:load-songs')
24
            // the short description shown while running "php bin/console list"
25
            ->setDescription('Load songlist')
26
            // the full command description shown when running the command with
27
            // the "--help" option
28
            ->setHelp("Load songlist from XLS file")
29
            ->addArgument('file', InputArgument::REQUIRED, 'Name of the CSV file.');
30
    }
31
32
    protected function execute(InputInterface $input, OutputInterface $output)
33
    {
34
35
        $loader = new SongLoader();
36
37
        $file = $input->getArgument('file');
38
        $songsLoaded = $loader->run($file, $this->getContainer()->get('database_connection'));
39
        $output->writeln("Loaded $songsLoaded songs from $file");
40
    }
41
}
42