stingus/StingusJiraBundle

View on GitHub
Command/GenerateCertCommand.php

Summary

Maintainability
A
3 hrs
Test Coverage

Method execute has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('<info>Generate private / public keys for JIRA</info>');

        $countryQuestion = new Question('Enter the country name (eg. US): ');
Severity: Major
Found in Command/GenerateCertCommand.php - About 3 hrs to fix

    The method execute() has 106 lines of code. Current threshold is set to 100. Avoid really long methods.
    Open

        protected function execute(InputInterface $input, OutputInterface $output)
        {
            $output->writeln('<info>Generate private / public keys for JIRA</info>');
    
            $countryQuestion = new Question('Enter the country name (eg. US): ');
    Severity: Minor
    Found in Command/GenerateCertCommand.php by phpmd

    Remove error control operator '@' on line 112.
    Open

        protected function execute(InputInterface $input, OutputInterface $output)
        {
            $output->writeln('<info>Generate private / public keys for JIRA</info>');
    
            $countryQuestion = new Question('Enter the country name (eg. US): ');
    Severity: Minor
    Found in Command/GenerateCertCommand.php by phpmd

    ErrorControlOperator

    Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

    Example

    function foo($filePath) {
        $file = @fopen($filPath); // hides exceptions
        $key = @$array[$notExistingKey]; // assigns null to $key
    }

    Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

    Avoid excessively long variable names like $organizationalUnitQuestion. Keep variable name length under 20.
    Open

            $organizationalUnitQuestion = new Question('Enter the organization unit name: ');
    Severity: Minor
    Found in Command/GenerateCertCommand.php by phpmd

    LongVariable

    Since: 0.2

    Detects when a field, formal or local variable is declared with a long name.

    Example

    class Something {
        protected $reallyLongIntName = -3; // VIOLATION - Field
        public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
            $otherReallyLongName = -5; // VIOLATION - Local
            for ($interestingIntIndex = 0; // VIOLATION - For
                 $interestingIntIndex < 10;
                 $interestingIntIndex++ ) {
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#longvariable

    Avoid variables with short names like $dn. Configured minimum length is 3.
    Open

            $dn = [
    Severity: Minor
    Found in Command/GenerateCertCommand.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    There are no issues that match your filters.

    Category
    Status