Skip to content

Commit

Permalink
Fix codacy remaining errors (#2186)
Browse files Browse the repository at this point in the history
* [C/C++] fixing codacy errors
* [md] fixing codacy errors
  • Loading branch information
cvvergara authored Oct 14, 2021
1 parent c27cc39 commit efdef68
Show file tree
Hide file tree
Showing 16 changed files with 215 additions and 195 deletions.
124 changes: 96 additions & 28 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Contributors to pgRouting are expected to act respectfully toward others in accordance with the http://www.osgeo.org/code_of_conduct.
Contributors to pgRouting are expected to act respectfully toward others in
accordance with the [OSGeo's Code of Conduct](http://www.osgeo.org/code_of_conduct)

Full transcription:


# OSGeo Code of Conduct

Version: 1.0
Expand All @@ -11,62 +11,130 @@ Date: May 2015

## Introduction

This code of conduct governs how we behave in any OSGeo forum or event and whenever we will be judged by our actions. We expect it to be honored by everyone who participates in the OSGeo community formally or informally, or claims any affiliation with the OSGeo Foundation.
This code of conduct governs how we behave in any OSGeo forum or event and
whenever we will be judged by our actions. We expect it to be honored by
everyone who participates in the OSGeo community formally or informally, or
claims any affiliation with the OSGeo Foundation.

It applies to in-person events (such as conferences and related social events), IRC, public and private mailing lists, the issue tracker, the wiki, blogs, Twitter, and any other forums which the community uses for communication and interactions.
It applies to in-person events (such as conferences and related social events),
IRC, public and private mailing lists, the issue tracker, the wiki, blogs,
Twitter, and any other forums which the community uses for communication and
interactions.

This code is not exhaustive or complete. It serves to distill our common understanding of a collaborative, shared environment and goals. We expect it to be followed in spirit as much as in the letter, so that it can enrich all of us and the technical communities in which we participate.
This code is not exhaustive or complete. It serves to distill our common
understanding of a collaborative, shared environment and goals. We expect it to
be followed in spirit as much as in the letter, so that it can enrich all of us
and the technical communities in which we participate.

## Diversity Statement

OSGeo welcomes and encourages participation by everyone. We are committed to being a community that everyone feels good about joining, and we will always work to treat everyone well. No matter how you identify yourself or how others perceive you: we welcome you.
OSGeo welcomes and encourages participation by everyone. We are committed to
being a community that everyone feels good about joining, and we will always
work to treat everyone well. No matter how you identify yourself or how others
perceive you: we welcome you.
Specific Guidelines

We strive to:

- Be open.
We invite anyone to participate in our community. We preferably use public methods of communication for project-related messages, unless discussing something sensitive. This applies to messages for help or project-related support, too; not only is a public support request much more likely to result in an answer to a question, it also makes sure that any inadvertent mistakes made by people answering will be more easily detected and corrected.

We invite anyone to participate in our community. We preferably use public
methods of communication for project-related messages, unless discussing
something sensitive. This applies to messages for help or project-related
support, too; not only is a public support request much more likely to result
in an answer to a question, it also makes sure that any inadvertent mistakes
made by people answering will be more easily detected and corrected.

- Be empathetic, welcoming, friendly, and patient.
We work together to resolve conflict, assume good intentions, and do our best to act in an empathetic fashion. We may all experience some frustration from time to time, but we do not allow frustration to turn into a personal attack. A community where people feel uncomfortable or threatened is not a productive one. Note that we have a multi-cultural, multi-lingual community and some of us are non-native speakers. We should be respectful when dealing with other community members as well as with people outside our community.

We work together to resolve conflict, assume good intentions, and do our best
to act in an empathetic fashion. We may all experience some frustration from
time to time, but we do not allow frustration to turn into a personal attack.
A community where people feel uncomfortable or threatened is not a productive
one. Note that we have a multi-cultural, multi-lingual community and some of us
are non-native speakers. We should be respectful when dealing with other
community members as well as with people outside our community.

- Be collaborative.
Our work will be used by other people, and in turn we will depend on the work of others. When we make something for the benefit of OSGeo, we are willing to explain to others how it works, so that they can build on the work to make it even better. Any decision we make will affect users and colleagues, and we take those consequences seriously when making decisions.

Our work will be used by other people, and in turn we will depend on the
work of others. When we make something for the benefit of OSGeo, we are willing
to explain to others how it works, so that they can build on the work to make
it even better. Any decision we make will affect users and colleagues, and we
take those consequences seriously when making decisions.

- Be inquisitive.
Nobody knows everything! Asking questions early avoids many problems later, so questions are encouraged, though they may be directed to the appropriate forum. Those who are asked should be responsive and helpful, within the context of our shared goal of improving OSGeo.

Nobody knows everything! Asking questions early avoids many problems later,
so questions are encouraged, though they may be directed to the appropriate
forum. Those who are asked should be responsive and helpful, within the context
of our shared goal of improving OSGeo.

- Be careful in the words that we choose.
Whether we are participating as professionals or volunteers, we value professionalism in all interactions, and take responsibility for our own speech. Be kind to others. Do not insult or put down other participants.

Whether we are participating as professionals or volunteers, we value
professionalism in all interactions, and take responsibility for our own
speech. Be kind to others. Do not insult or put down other participants.

- Be concise
Keep in mind that what you write once will be read by hundreds of persons. Writing a short email means people can understand the conversation as efficiently as possible. Short emails should always strive to be empathetic, welcoming, friendly and patient. When a long explanation is necessary, consider adding a summary.

Try to bring new ideas to a conversation so that each mail adds something unique to the thread, keeping in mind that the rest of the thread still contains the other messages with arguments that have already been made.
Keep in mind that what you write once will be read by hundreds of persons.
Writing a short email means people can understand the conversation as
efficiently as possible. Short emails should always strive to be empathetic,
welcoming, friendly and patient. When a long explanation is necessary, consider
adding a summary.

Try to stay on topic, especially in discussions that are already fairly large.
Try to bring new ideas to a conversation so that each mail adds something
unique to the thread, keeping in mind that the rest of the thread still
contains the other messages with arguments that have already been made.

Try to stay on topic, especially in discussions that are already fairly large.

- Step down considerately.
Members of every project come and go. When somebody leaves or disengages from the project they should tell people they are leaving and take the proper steps to ensure that others can pick up where they left off. In doing so, they should remain respectful of those who continue to participate in the project and should not misrepresent the project's goals or achievements. Likewise, community members should respect any individual's choice to leave the project.

Members of every project come and go. When somebody leaves or disengages
from the project they should tell people they are leaving and take the proper
steps to ensure that others can pick up where they left off. In doing so, they
should remain respectful of those who continue to participate in the project and
should not misrepresent the project's goals or achievements. Likewise, community
members should respect any individual's choice to leave the project.

## Anti-Harassment

Harassment and other exclusionary behaviour are not acceptable. This includes, but is not limited to:
Harassment and other exclusionary behaviour are not acceptable. This includes,
but is not limited to:

- Personal insults or discriminatory jokes and language, especially those using racist or sexist terms.
- Offensive comments, excessive or unnecessary profanity.
- Intimidation, violent threats or demands.
- Sustained disruption of sessions or events.
- Stalking, harassing photography or recording.
- Unwelcome physical contact or sexual attention.
- Repeated harassment of others. In general, if someone asks you to stop, then stop.
- Posting (or threatening to post) other people's personally identifying information ("doxing").
- Sharing private content, such as emails sent privately or non-publicly, or unlogged forums such as IRC channel history.
- Advocating for, or encouraging, any of the above behaviour.
- Personal insults or discriminatory jokes and language, especially those using
racist or sexist terms.

## Reporting Guidelines
- Offensive comments, excessive or unnecessary profanity.

- Intimidation, violent threats or demands.

- Sustained disruption of sessions or events.

- Stalking, harassing photography or recording.

If you believe someone is breaking this code of conduct, you may reply to them, and point to this code of conduct. Such messages may be in public or in private, whatever is most appropriate. Assume good faith; it is more likely that participants are unaware of their bad behaviour than that they intentionally try to degrade the quality of the discussion. Should there be difficulties in dealing with the situation, you may report your concerns to event staff, a forum leader or the OSGeo Board. Serious or persistent offenders may be expelled from the event or forum by event organizers or forum leaders.
- Unwelcome physical contact or sexual attention.

- Repeated harassment of others. In general, if someone asks you to stop, then
stop.

- Posting (or threatening to post) other people's personally identifying
information ("doxing").

- Sharing private content, such as emails sent privately or non-publicly, or
unlogged forums such as IRC channel history.

- Advocating for, or encouraging, any of the above behaviour.

## Reporting Guidelines

If you believe someone is breaking this code of conduct, you may reply to them,
and point to this code of conduct. Such messages may be in public or in private,
whatever is most appropriate. Assume good faith; it is more likely that
participants are unaware of their bad behaviour than that they intentionally try
to degrade the quality of the discussion. Should there be difficulties in
dealing with the situation, you may report your concerns to event staff, a forum
leader or the OSGeo Board. Serious or persistent offenders may be expelled from
the event or forum by event organizers or forum leaders.
59 changes: 40 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,63 @@
# How to contribute

We are really glad you are reading this because we need volunteer developers to help with this project.
We are really glad you are reading this because we need volunteer developers to
help with this project.

If you have not already, come find us on [![Join the chat at https://gitter.im/pgRouting/pgrouting](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pgRouting/pgrouting?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) or contact us via [mailing list](http://lists.osgeo.org/mailman/listinfo/pgrouting-dev). We want you to work on things you're excited about. Drop a message and if someone can assist you, will contact you back ASAP.
If you have not already, come find us on [![Join the chat at
https://gitter.im/pgRouting/pgrouting](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pgRouting/pgrouting?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
or contact us via [mailing
list](http://lists.osgeo.org/mailman/listinfo/pgrouting-dev). We want you to
work on things you're excited about. Drop a message and if someone can assist
you, will contact you back ASAP.

Here are some important resources:

* [pgRouting for Developers](http://docs.pgrouting.org/doxy/2.4/index.html) has the internals C/C++ code information,
* [Wish list on the wiki](https://github.com/pgRouting/pgrouting/wiki/GSoC-Ideas) is the foot view of what we think the community needs.
* [Additional wish lst](https://github.com/pgRouting/pgrouting/issues?q=is%3Aopen+is%3Aissue+label%3A%22Functionality+Request%22). (TODO to move the information to the wiki wish list)
* Participate in the [discussions](https://github.com/pgRouting/pgrouting/issues?q=is%3Aopen+is%3Aissue+label%3ADiscussion).
* Participate in fixing [Documentation](https://github.com/pgRouting/pgrouting/issues?q=is%3Aopen+is%3Aissue+label%3ADocumentation).
* Find a bug? [Let us know](https://github.com/pgRouting/pgrouting/issues).
* [pgRouting for Developers](https://docs.pgrouting.org/doxygen) has the
internals C/C++ code information,

* [Wish list on the wiki](https://github.com/pgRouting/pgrouting/wiki/GSoC-Ideas)
is the foot view of what we think the community needs.

* [Additional wish
lst](https://github.com/pgRouting/pgrouting/issues?q=is%3Aopen+is%3Aissue+label%3A%22Functionality+Request%22).
(TODO to move the information to the wiki wish list)

* Participate in the
[discussions](https://github.com/pgRouting/pgrouting/discussions).

* Participate in fixing
[Documentation](https://github.com/pgRouting/pgrouting/issues?q=is%3Aopen+is%3Aissue+label%3ADocumentation).

* Find a bug? [Let us know](https://github.com/pgRouting/pgrouting/issues).

## Contribution agreement

Any kind of contribution will automatically fall to the following Licences:

- Code contribution: GNU General Public License v2.0 or later,
- Directly by making an explicit pull request.
- Indirectly by posting code on issues/wiki/gitter/mailng lists
- Documentation contribution:
- Creative Commons Attribution-Share Alike 3.0
* Code contribution: GNU General Public License v2.0 or later,
* Directly by making an explicit pull request.
* Indirectly by posting code on issues/wiki/gitter/mailng lists

* Documentation contribution:
* Creative Commons Attribution-Share Alike 3.0

## Submitting changes

Write a clear log message for your commits. One-line messages are fine for small
changes, but bigger changes should have more information.

Write a clear log message for your commits. One-line messages are fine for small changes, but bigger changes should have more information.
Fill in the commit message template.

## Coding conventions

Start reading our code and you'll get the hang of it. We optimize for readability.
This is open source software. Consider the people who will read your code, and make it look nice for them.
Start reading our code and you'll get the hang of it. We optimize for
readability.

* We indent using four spaces (soft tabs)
* We use cpplint for linting C/C++ code.
This is open source software. Consider the people who will read your code, and
make it look nice for them.

* We indent using four spaces (soft tabs)
* We use cpplint for linting C/C++ code.

Thanks,
pgRouting team

29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

[![Join the chat at https://gitter.im/pgRouting/pgrouting](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pgRouting/pgrouting?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

## STATUS

### Branches
## Branches

* The *master* branch has the development of the next micro release
* The *develop* branch has the development of the next minor/major release

For the complete list of releases go to:
https://github.com/pgRouting/pgrouting/releases


## LINKS

* https://pgrouting.org/
Expand All @@ -30,14 +27,21 @@ pgRouting extends the PostGIS/PostgreSQL geospatial database to provide geospati
This library contains the following features:

* All Pairs Shortest Path Algorithms

* A-star algorithm

* Bi-directional algorithms

* A variety of applications of Dijkstra algorithms

* Cost functions
* With points

* Driving Distance
* With points

* Yen's algorithm

* Traveling Sales Person (TSP)

and many more.
Expand All @@ -46,20 +50,23 @@ The latest documentation: http://docs.pgrouting.org/latest

## REQUIREMENTS

Building requirements
--------------------
* Perl
### Building requirements

* perl

* C and C++ compilers
* Compiling with Boost 1.56 up to Boost 1.74 requires C++ Compiler with C++03 or C++11 standard support
* Compiling with Boost 1.75 requires C++ Compiler with C++14 standard support

* Postgresql = Supported version by PostgreSQL

* The Boost Graph Library (BGL) >= 1.56

* CMake >= 3.2
* Sphinx >= 4.0.0

* Sphinx >= 4.0.0

User's requirements
--------------------
### User's requirements

* PostGIS

Expand Down Expand Up @@ -101,5 +108,3 @@ See online documentation: http://docs.pgrouting.org/latest/en/index.html
* Most features are available under [GPL-2.0-or-later](https://spdx.org/licenses/GPL-2.0-or-later.html)
* Some Boost extensions are available under Boost license (see LICENSE_1_0.txt)
* Some code contributed by iMaptools.com is available under MIT-X license.


6 changes: 3 additions & 3 deletions include/c_common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ Purpose of this directory
----------------------------------

- Directory having files included exclusively by the `*.c` files

- forbidden to be used on c++ code
- this prohibition is not enforced but will be in the future

- Convention:
- files must end with `_input`


Example
----------------------------------

in `foo.c` file

```C
#include "c_common/edges_input.h"
#include "c_common/arrays_input.h"

```
1 change: 0 additions & 1 deletion include/c_common/postgres_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,5 @@ void pgr_SPI_finish(void);
void pgr_SPI_connect(void);
SPIPlanPtr pgr_SPI_prepare(char* sql);
Portal pgr_SPI_cursor_open(SPIPlanPtr SPIplan);
char* pgr_cstring2char(const char *inStr);

#endif // INCLUDE_C_COMMON_POSTGRES_CONNECTION_H_
1 change: 0 additions & 1 deletion include/cpp_common/pgr_bidirectional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ class Pgr_bidirectional {
double INF; //!< infinity

double best_cost;
bool cost_only;

mutable std::ostringstream m_log;
Priority_queue forward_queue;
Expand Down
2 changes: 2 additions & 0 deletions include/spanningTree/pgr_randomSpanningTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class Pgr_randomSpanningTree {

std::vector< SpanTree_rt > resul;
return resul;
#if 0
std::vector< SpanTree_rt > results;
double totalcost = 0;
SpanTree_rt tmp;
Expand Down Expand Up @@ -130,6 +131,7 @@ class Pgr_randomSpanningTree {
}
return results;
}
#endif
};

template < class G >
Expand Down
2 changes: 2 additions & 0 deletions include/yen/pgr_ksp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class Pgr_ksp : public Pgr_messages {

public:
Pgr_ksp() :
m_start(0),
m_end(0),
m_K(0),
m_heap_paths(false) {
m_vis = new Visitor;
Expand Down
Loading

0 comments on commit efdef68

Please sign in to comment.