\label{doc_api_review_core_keyGetName_md_md_doc_api_review_core_keyGetName}%
\Hypertarget{doc_api_review_core_keyGetName_md_md_doc_api_review_core_keyGetName}%

\begin{DoxyItemize}
\item start = 2021-\/02-\/22 13\+:40
\item end = 2021-\/02-\/22 14\+:20
\item moderator = Stefan Hanreich \href{mailto:stefanhani@gmail.com}{\texttt{ stefanhani@gmail.\+com}}
\item reviewer = Philipp Gackstatter
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyGetName_md_autotoc_md889}{}\doxysection{Signature}\label{doc_api_review_core_keyGetName_md_autotoc_md889}
{\ttfamily ssize\+\_\+t \mbox{\hyperlink{group__keyname_gab29a850168d9b31c9529e90cf9ab68be}{key\+Get\+Name(const Key $\ast$key, char $\ast$returned\+Name, size\+\_\+t max\+Size)}}}\hypertarget{doc_api_review_core_keyGetName_md_autotoc_md890}{}\doxysection{Checklist}\label{doc_api_review_core_keyGetName_md_autotoc_md890}
\hypertarget{doc_api_review_core_keyGetName_md_autotoc_md891}{}\doxysubsubsection{Doxygen}\label{doc_api_review_core_keyGetName_md_autotoc_md891}
(bullet points are in order of appearance)


\begin{DoxyItemize}
\item \mbox{[} \mbox{]} First line explains briefly what the function does ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} owner still recent?
\end{DoxyItemize}
\item \mbox{[} \mbox{]} Simple example or snippet how to use the function ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} move up
\end{DoxyItemize}
\item \mbox{[} \mbox{]} Longer description of function containing common use cases ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} max\+Size special case has very long description ($>$50\% of body) ~\newline

\item \mbox{[} \mbox{]} max\+Size special case move description to pre / post / return values ~\newline

\item \mbox{[} \mbox{]} mention explicitly, that user has to manage their buffer ~\newline

\item \mbox{[} \mbox{]} move special case \textquotesingle{}not enough space\textquotesingle{} to return values / pre / post
\end{DoxyItemize}
\item \mbox{[} \mbox{]} Description of functions reads nicely ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} remove / define abbreviated (make it more explicit) ~\newline

\item \mbox{[} \mbox{]} \char`\"{}\+Writes key\+Name of \`{}key\`{} into the provided buffer \`{}returned\+Name\`{} if it is shorter than \`{}max\+Size\`{}\char`\"{}
\end{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily @pre} ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily key} is a valid Key ~\newline

\item \mbox{[} \mbox{]} {\ttfamily returned\+Name} is a pre-\/allocated buffer ~\newline

\item \mbox{[} \mbox{]} max\+Size is the size of {\ttfamily returned\+Name}
\end{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily @post} ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily returned\+Name} contains the name of the Key ~\newline

\item \mbox{[} \mbox{]} {\ttfamily key} is not modified
\end{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily @invariant} ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily key} is not modified
\end{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily @param} for every parameter ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily returned\+Name}\+: pre-\/allocated buffer to write the key name into
\end{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily @return} / {\ttfamily @retval} ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily 1}\+: when only a null-\/terminator was written ~\newline

\item \mbox{[} \mbox{]} {\ttfamily -\/1}\+: then -\/$>$ than ~\newline

\item \mbox{[} \mbox{]} {\ttfamily -\/1}\+: standardize / change \textquotesingle{}keyname\textquotesingle{} / \textquotesingle{}key name\textquotesingle{} or \textquotesingle{}Key name\textquotesingle{} ~\newline

\item \mbox{[} \mbox{]} {\ttfamily -\/1} check if null pointer case is even still applicable ~\newline

\item \mbox{[} \mbox{]} {\ttfamily -\/1} split into two lines\+: max\+Size / NULL pointer
\end{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily @since} ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} add
\end{DoxyItemize}
\item \mbox{[}x\mbox{]} {\ttfamily @ingroup}
\item \mbox{[} \mbox{]} {\ttfamily @see} ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} key\+Name ~\newline

\item \mbox{[} \mbox{]} key\+Get\+Unescaped\+Name ~\newline

\item \mbox{[} \mbox{]} key\+Get\+Base\+Name ~\newline

\item \mbox{[} \mbox{]} key\+Get\+Namespace
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyGetName_md_autotoc_md892}{}\doxysubsection{Naming}\label{doc_api_review_core_keyGetName_md_autotoc_md892}

\begin{DoxyItemize}
\item Abbreviations used in function names must be defined in the \mbox{\hyperlink{doc_help_elektra-glossary_md}{Glossary}}
\item \mbox{[}x\mbox{]} Function names should neither be too long, nor too short
\item \mbox{[} \mbox{]} Function name should be clear and unambiguous ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily key\+Name} vs {\ttfamily \mbox{\hyperlink{group__keyname_gab29a850168d9b31c9529e90cf9ab68be}{key\+Get\+Name()}}}
\end{DoxyItemize}
\item \mbox{[} \mbox{]} Abbreviations used in parameter names must be defined in the \mbox{\hyperlink{doc_help_elektra-glossary_md}{Glossary}} ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} max -\/ maybe just rename to {\ttfamily buffer\+Size}
\end{DoxyItemize}
\item \mbox{[} \mbox{]} Parameter names should neither be too long, nor too short ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily returned\+Name} -\/$>$ {\ttfamily name} / {\ttfamily name\+Buffer}
\end{DoxyItemize}
\item \mbox{[} \mbox{]} Parameter names should be clear and unambiguous ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily max\+Size} -\/$>$ {\ttfamily buffer\+Size}
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyGetName_md_autotoc_md893}{}\doxysubsection{Compatibility}\label{doc_api_review_core_keyGetName_md_autotoc_md893}
(only in PRs)


\begin{DoxyItemize}
\item \mbox{\hyperlink{doc_dev_symbol-versioning_md}{Symbol versioning}} is correct for breaking changes
\item ABI/\+API changes are forward-\/compatible (breaking backwards-\/compatibility to add additional symbols is fine)
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyGetName_md_autotoc_md894}{}\doxysubsection{Parameter \& Return Types}\label{doc_api_review_core_keyGetName_md_autotoc_md894}

\begin{DoxyItemize}
\item Function parameters should use enum types instead of boolean types wherever sensible
\item \mbox{[}x\mbox{]} Wherever possible, function parameters should be {\ttfamily const}
\item \mbox{[}x\mbox{]} Wherever possible, return types should be {\ttfamily const}
\item \mbox{[}x\mbox{]} Functions should have the least amount of parameters feasible
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyGetName_md_autotoc_md895}{}\doxysubsection{Structural Clarity}\label{doc_api_review_core_keyGetName_md_autotoc_md895}

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} Functions should do exactly one thing
\item \mbox{[}x\mbox{]} Function name has the appropriate prefix
\item \mbox{[} \mbox{]} Order of signatures in kdb.\+h.\+in is the same as Doxygen ~\newline

\begin{DoxyItemize}
\item wrong order
\end{DoxyItemize}
\item \mbox{[}x\mbox{]} No functions with similar purpose exist
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyGetName_md_autotoc_md896}{}\doxysubsection{Memory Management}\label{doc_api_review_core_keyGetName_md_autotoc_md896}

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} Memory Management should be handled by the function wherever possible ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} pass variable and return size instead ~\newline

\item \mbox{[} \mbox{]} remove {\ttfamily max\+Size} param
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyGetName_md_autotoc_md897}{}\doxysubsection{Extensibility}\label{doc_api_review_core_keyGetName_md_autotoc_md897}

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} Function is easily extensible, e.\+g., with flags
\item \mbox{[} \mbox{]} Documentation does not impose limits, that would hinder further extensions ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} nothing is written on max\+Size $<$ name\+Size (would be fixed with memory management suggestion from above)
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyGetName_md_autotoc_md898}{}\doxysubsection{Tests}\label{doc_api_review_core_keyGetName_md_autotoc_md898}

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} Function code is fully covered by tests ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} Lines 365 / 366
\end{DoxyItemize}
\item \mbox{[} \mbox{]} All possible error states are covered by tests ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} test empty string
\end{DoxyItemize}
\item All possible enum values are covered by tests
\item \mbox{[}x\mbox{]} No inconsistencies between tests and documentation
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyGetName_md_autotoc_md899}{}\doxysection{Summary}\label{doc_api_review_core_keyGetName_md_autotoc_md899}
Different error codes for different errors\hypertarget{doc_api_review_core_keyGetName_md_autotoc_md900}{}\doxysection{Other Issues discovered (unrelated to function)}\label{doc_api_review_core_keyGetName_md_autotoc_md900}
