Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Some false positives #1

Closed
benlangfeld opened this issue Sep 22, 2010 · 8 comments
Closed

Some false positives #1

benlangfeld opened this issue Sep 22, 2010 · 8 comments

Comments

@benlangfeld
Copy link

Details of some false positives here: http://gist.github.com/592051

I can't for the life of me figure out what the issue is here, but I think it comes from somewhere around line 300 of capp_lint.py

@aparajita
Copy link
Owner

Thanks, I'll look into it.

@klaaspieter
Copy link
Contributor

Some more false positives:

Specifying a category (happens when copy pasting Cocoa)
acceptDrop:(id)theDragInfo

Incorrect indentation (I'd like to have some freedom here)

var highlightedBezelColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:[
    [[CPImage alloc] initWithContentsOfFile:highlightedLeftImage size:CGSizeMake(3.0, 30.0)],
    [[CPImage alloc] initWithContentsOfFile:highlightedFillImage size:CGSizeMake(1.0, 30.0)],
    [[CPImage alloc] initWithContentsOfFile:highlightedRightImage size:CGSizeMake(12.0, 30.0)]
] isVertical:NO]];

Declaring a property

 @outlet CPTableView _listsTableView @accessors(property=listsTableView);

@aparajita
Copy link
Owner

acceptDrop:(id)theDragInfo

What is the error you are getting?

Incorrect indentation (I'd like to have some freedom here)

You'll have to discuss it on the list to get some concensus, Alexander agreed with me that everything should be indented at least to the first character of the identifier.

Declaring a property

Will be fixed in the next commit, coming soon.

@klaaspieter
Copy link
Contributor

acceptDrop:(id)theDragInfo

What is the error you are getting?

comparison operator without surrounding spaces.

@aparajita
Copy link
Owner

Then the method declaration must be malformed (perhaps missing the "-" or return type), because that check is skipped for well-formed method declarations.

@klaaspieter
Copy link
Contributor

The method declaration is divider over multiple lines. My guess is that it properly skips the first line of the method declaration but doesn't for any subsequent lines.

@klaaspieter
Copy link
Contributor

CPSplitView lines 628 to 634.

 if (index + 1 == count)
    viewFrame.size[_sizeComponent] = bounds.size[_sizeComponent] - viewFrame.origin[_originComponent];
else if (totalSizableSpace && isSizable && lastSizableIndex === index)
    viewFrame.size[_sizeComponent] = MAX(0, ROUND([view frame].size[_sizeComponent] + remainingFlexibleSpace))
else if (isSizable || !totalSizableSpace)
{
    viewFrame.size[_sizeComponent] = MAX(0, ROUND(ratio * [view frame].size[_sizeComponent]));
    remainingFlexibleSpace -= (viewFrame.size[_sizeComponent] - [view frame].size[_sizeComponent]);
}
else if (totalSizableSpace && !isSizable)
    viewFrame.size[_sizeComponent] = [view frame].size[_sizeComponent];

@aparajita
Copy link
Owner

Fixed. In actual fact it isn't a false positive, it's just wrongly labeled. The code after the var block is not outdented as it should be. This is specifically flagged in the latest version on master.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants