Showing 428 of 1,426 total issues
Method fromContestParticipation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function fromContestParticipation(
ContestParticipation $contestParticipation
): ContestParticipationEntity {
if ($contestParticipation->getAddress()) {
$address = AddressEmbeddable::fromAddress(
Method add
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function add(Request $request): Response
{
$form = $this->createCompanyForm(null, $request->getLocale() == 'nl');
$form->handleRequest($request);
Function remove
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
remove: function( owner, key ) {
var i,
cache = owner[ this.expando ];
if ( cache === undefined ) {
Function _transitionComplete
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_proto._transitionComplete = function _transitionComplete(element, active, callback) {
if (active) {
$$$1(active).removeClass(ClassName.SHOW + " " + ClassName.ACTIVE);
var dropdownChild = $$$1(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
Function compareObjects
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var compareObjects = function (objectA, objectB, compareLength) {
// Create arrays of property names
var getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
var arr = [];
for (var k in obj) {
Method __construct
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct(
iterable $companies,
CompanyPlayedQuizzesRepository $companyPlayedQuizzesRepository,
EmployeeParticipationRepository $employeeParticipationRepository,
TopScoreRepository $topScoreRepository,
Method getParticipantsInTeam
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getParticipantsInTeam(UuidInterface $teamId): \Traversable
{
$batchSize = 10;
$firstResult = 0;
Method getValues
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getValues(Company $company)
{
$data = $this->normalizer->normalize($company);
$values = [];
Method normalize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function normalize($company, $format = null, array $context = array()): array
{
$aliases = array_map(
function (TranslatedAlias $translatedAlias) use ($format) {
return $this->translatedAliasNormalizer->normalize(
Consider simplifying this complex logical expression. Open
Open
if ( support.matchesSelector && documentIsHTML &&
!compilerCache[ expr + " " ] &&
( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
QuizService $quizService,
CompanyRepository $companyRepository,
PartnerRepository $partnerRepository,
TeamRepository $teamRepository,
AnswerRepository $answerRepository,
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
string $id,
string $email,
string $lastName,
string $firstName,
string $role,
Function contest
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
public function contest(Request $request, string $quizId): Response
{
try {
$quiz = $this->quizRepository->getById(Uuid::fromString($quizId));
- Read upRead up
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
Function access
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
StartedQuizRepository $startedQuizRepository,
FinishedQuizRepository $finishedQuizRepository,
PassedQuizRepository $passedQuizRepository,
UniqueParticipantRepository $uniqueParticipantRepository,
PartnerRepository $partnerRepository,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
UuidInterface $id,
Email $email,
NotEmptyString $lastName,
NotEmptyString $firstName,
Role $role,
Avoid deeply nested control flow statements. Open
Open
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
cur += clazz + " ";
}
Avoid deeply nested control flow statements. Open
Open
while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
cur = cur.replace( " " + clazz + " ", " " );
}
Avoid deeply nested control flow statements. Open
Open
if ( conv && s.throws ) {
response = conv( response );
} else {
try {
response = conv( response );
Function setMatcher
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {