Forums : Feedback Forum

Dear Open Hub Users,

We’re excited to announce that we will be moving the Open Hub Forum to https://community.blackduck.com/s/black-duck-open-hub. Beginning immediately, users can head over, register, get technical help and discuss issue pertinent to the Open Hub. Registered users can also subscribe to Open Hub announcements here.


On May 1, 2020, we will be freezing https://www.openhub.net/forums and users will not be able to create new discussions. If you have any questions and concerns, please email us at [email protected]

MIT licence identification

I'm working on DbLinq project (http://www.ohloh.net/projects/dblinq), and the code analysis determines that it is an MIT licence present in only 2 files (see http://www.ohloh.net/projects/dblinq/analyses/latest)
My problem is that the MIT licence is present in almost every file, and that makes much more than two.

I paste hereafter the header (C# file) that is apparently not recognized:

#region MIT license
//
// Copyright (c) 2007-2008 Jiri Moudry
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the Software), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#endregion

Pascal Craponne almost 17 years ago
 

Hi Pascal,

The license detector is not incredibly smart, so unless you specifically give the name of the license it will probably not be detected.

If you include the literal name MIT License somewhere in the header file, we will correctly identify it.

Robin Luckey almost 17 years ago
 

Well... As you may have seen in my post, there is a
(sharp)region MIT license
in the header, so maybe this line isn't recognized...

Pascal Craponne almost 17 years ago
 

Sorry, I didn't understand that the region labels were actually part of the file content -- I thought you were delimiting the quoted content.

I will look in the original source files and see what I can figure out.

Robin Luckey almost 17 years ago
 

OK :)
My post wasn't clear because of the automatic formatting.
So, yes, the header includes the region definitions.

Pascal Craponne almost 17 years ago
 

Hi Pascal,

It took some digging, but I've found the cause of the problem.

Our parser examines only the comments when looking for license declarations.

In this particular case, the #region line is considered part of the C# code, not part of the comment. So our license detection code never sees this line with its MIT license suffix.

If the phrase MIT license is moved into the actual comment body, our parser will discover it.

Robin Luckey almost 17 years ago
 

OK, thanks.
In this case, it would be interesting to parse also the regions that come before the usings/namespaces/classes.

Pascal Craponne almost 17 years ago