You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the code there are a lot of improvements that can be made to the design to make the code easier to understand and maintain. As new issues are discovered, add them here:
Let's chat before anything gets implemented.
Refactor functions that take too many parameters. Too many is something you'll know when you see it (e.g. msa::perform_msa_round_gapped)
Use smart pointers (std::shared_ptr and std::unique_ptr)
Don't pass by non-const reference. It's unclear in the caller that the value might be changed. Use a pointer instead.
Run cppcheck --enable=all src/ and fix issues. Read its documentation because unusedFunction is run and it can produce false positives.
Use OOP for methods that operate on an object (e.g. make_string only ever operates on a Sequence so should be a member function of Sequence).
Create Alignment class. This term appears very often. It's comparison operators should implement seq_data::compare_alignments so you can then do if alignment1 == alignment2 in the code.
Let the compiler infer the type using auto. This makes code much more readable (assuming your function name indicate clearly what's happening).
Give functions meaningful names (e.g. fasta::make_string should be fasta::sequence_to_string or better Sequence::to_string)
Rename all the fasta stuff to something else because it's not fasta and that's confusing.
Looking at the code there are a lot of improvements that can be made to the design to make the code easier to understand and maintain. As new issues are discovered, add them here:
Let's chat before anything gets implemented.
msa::perform_msa_round_gapped)std::shared_ptrandstd::unique_ptr)cppcheck --enable=all src/and fix issues. Read its documentation becauseunusedFunctionis run and it can produce false positives.make_stringonly ever operates on aSequenceso should be a member function ofSequence).Alignmentclass. This term appears very often. It's comparison operators should implementseq_data::compare_alignmentsso you can then doif alignment1 == alignment2in the code.auto. This makes code much more readable (assuming your function name indicate clearly what's happening).fasta::make_stringshould befasta::sequence_to_stringor betterSequence::to_string)