Showing 3,272 of 4,939 total issues
Method addClosuresForBeforeLoopBodyAnalysisCapability
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function addClosuresForBeforeLoopBodyAnalysisCapability(
ClosuresForKind $closures_for_kind,
BeforeLoopBodyAnalysisCapability $plugin
): void {
$plugin_analysis_class = $plugin->getBeforeLoopBodyAnalysisVisitorClassName();
Method checkExpressionInDynamicString
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function checkExpressionInDynamicString(Node $expr_node): void
{
$code_base = $this->code_base;
$context = $this->context;
$type = UnionTypeVisitor::unionTypeFromNode(
Method testClassAccess
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function testClassAccess(
Clazz $source_class,
Clazz $target_class,
CodeBase $code_base
): void {
Method visitMethod
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitMethod(Node $node): Context
{
if (!$this->context->isInFunctionLikeScope()) {
throw new AssertionError("Must be in function-like scope to get method");
}
Method visitConditional
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitConditional(Node $node): UnionType
{
$cond_node = $node->children['cond'];
$cond_truthiness = UnionTypeVisitor::checkCondUnconditionalTruthiness($cond_node);
// For the shorthand $a ?: $b, the cond node will be the truthy value.
Method findNodeAtOffsetRecursive
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function findNodeAtOffsetRecursive(\Microsoft\PhpParser\Node $parser_node, int $offset)
{
foreach ($parser_node->getChildNodesAndTokens() as $key => $node_or_token) {
if ($node_or_token instanceof Token) {
// fprintf(
Method createArrayShapeType
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function createArrayShapeType(array $key_set): ArrayShapeType
{
$field_types = [];
foreach ($key_set as $key => $child) {
Method getClassXMLFiles
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getClassXMLFiles(): array
{
return $this->memoize(__METHOD__, /** @return array<string,SimpleXMLElement> */ function (): array {
$remaining_folders = [
$this->reference_directory,
Method getAvailableMethodPHPDocSummaries
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getAvailableMethodPHPDocSummaries(): array
{
return $this->memoize(__METHOD__, /** @return array<string,string> */ function (): array {
$code_base = $this->code_base;
$function_name_map = [];
Method getAvailableMethodPHPDocSummaries
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getAvailableMethodPHPDocSummaries(): array
{
return $this->memoize(__METHOD__, /** @return array<string,string> */ function (): array {
$code_base = $this->code_base;
$function_name_map = [];
Method warnInvalidArgumentType
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
CodeBase $code_base,
Context $context,
FunctionInterface $method,
Parameter $alternate_parameter,
UnionType $alternate_parameter_type,
Method inheritConstant
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function inheritConstant(
CodeBase $code_base,
ClassConstant $constant
): void {
$constant_fqsen = FullyQualifiedClassConstantName::make(
Method finishAnalyzingURIsWithoutPcntl
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function finishAnalyzingURIsWithoutPcntl(array $uris_to_analyze): void
{
$paths_to_analyze = \array_keys($uris_to_analyze);
Logger::logInfo('in ' . __METHOD__ . ' paths: ' . StringUtil::jsonEncode($paths_to_analyze));
// When there is no pcntl:
Method hydrateConstantsOnce
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function hydrateConstantsOnce(CodeBase $code_base): void
{
foreach ($this->getAncestorFQSENList() as $fqsen) {
if ($code_base->hasClassWithFQSEN($fqsen)) {
$code_base->getClassByFQSENWithoutHydrating(
Method extractParamTagsFromDocComment
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function extractParamTagsFromDocComment(AddressableElementInterface $element, bool $with_param_details = true): array
{
$doc_comment = $element->getDocComment();
if (!\is_string($doc_comment)) {
return [];
Method canCastToNonNullableType
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function canCastToNonNullableType(Type $type): bool
{
if ($type instanceof ScalarType) {
switch ($type::NAME) {
case 'float':
Method extractNameList
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function extractNameList(string $list_string): array
{
$results = [];
$prev_parts = [];
$delta = 0;
Method suggestSimilarClassConstant
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function suggestSimilarClassConstant(CodeBase $code_base, Context $context, FullyQualifiedClassConstantName $class_constant_fqsen): ?Suggestion
{
if (Config::getValue('disable_suggestions')) {
return null;
}
Method findNonUnaryParentNode
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function findNonUnaryParentNode(Node $node): array
{
$parent = \end($this->parent_node_list);
if (!$parent) {
return [null, true];
Method getAnalyzeFunctionCallClosuresStatic
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function getAnalyzeFunctionCallClosuresStatic(CodeBase $code_base): array
{
$result = [];
$add_callable_checker_closure = static function (FunctionInterface $function) use (&$result): void {
// Generate a de-duplicated closure.