Eluinhost/TeamspeakAuth

View on GitHub

Showing 9 of 19 total issues

Function exports has 124 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(grunt) {

    grunt.loadNpmTasks("grunt-bower-install-simple");
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
Severity: Major
Found in Gruntfile.js - About 4 hrs to fix

    DefaultTeamspeakHelper has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class DefaultTeamspeakHelper implements TeamspeakHelper {
    
        private $server;
        private $entityManager;
        private $groupID;

      Function link has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  link: function($scope, $element, attr) {
                      //setup errors
                      $scope.errors = [];
                      $scope.addError = function(msg) {
                          $scope.errors.push({msg: msg, type: 'alert round'});
      Severity: Minor
      Found in src/PublicUHC/Bundle/TeamspeakAuthBundle/Resources/public/js/app.js - About 1 hr to fix

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

            protected function execute(InputInterface $input, OutputInterface $output)
            {
                $output->writeln("<info>Starting server on port {$this->server->getPort()}... You can stop the server with Ctrl+C.</info>");
                $this->logger->info('Starting auth server on port '.$this->server->getPort());
        
        

          Function link has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      link: function($scope, $element, attr) { //called after DOM ready
          
                          //setup errors
                          $scope.errors = [];
                          $scope.addError = function(msg) {
          Severity: Minor
          Found in src/PublicUHC/Bundle/TeamspeakAuthBundle/Resources/public/js/app.js - About 1 hr to fix

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

                public function verifyClient(TeamspeakAccount $tsAccount, MinecraftAccount $mcAccount) {
                    //unauthenticate any accounts with the same MC name but not the same UUID
                    $mcqb = $this->entityManager->createQueryBuilder();
                    $mcqb->select('mcAccount')
                        ->from('PublicUHCTeamspeakAuthBundle:MinecraftAccount', 'mcAccount')

              Function verifyCodes has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                              $scope.verifyCodes = function() {
                                  if($scope.teamspeakCode == null || $scope.teamspeakCode.length == 0) {
                                      $scope.addError('Must supply the provided Teamspeak code');
                                      return;
                                  }
              Severity: Minor
              Found in src/PublicUHC/Bundle/TeamspeakAuthBundle/Resources/public/js/app.js - About 1 hr to fix

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

                    public function __construct(AuthServer $server,
                                                EntityManager $em,
                                                LoopInterface $loop,
                                                $keepAlive,
                                                $description,
                Severity: Major
                Found in src/PublicUHC/Bundle/TeamspeakAuthBundle/Command/ServerStartCommand.php - About 50 mins to fix

                  Function filterOnlineOnly has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function filterOnlineOnly($accountArray)
                      {
                          /** @var TeamspeakHelper $teamspeak_helper */
                          $teamspeak_helper = $this->get('teamspeak_helper');
                  
                  

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Severity
                  Category
                  Status
                  Source
                  Language