Questions tagged [maintainability]

Maintainability refers to the nature, methods, theory and art of maximizing the ease with which an asset may be sustained, modified or enhanced throughout the duration of its expected useful life.

306 questions
1
vote
1 answer

Is there a built in way to avoid magic strings with the Entity Framework's Include()?

Possible Duplicate: Entity Framework Include() strongly typed Ok, I've got an entity framework query where I use Include to tell it I want a related object loaded: var employees = _entities.Employees.Include("Manager").ToList() By using include I…
David
  • 24,700
  • 8
  • 63
  • 83
1
vote
1 answer

Extendable accessing of sqlite database on android platform

I am fairly new to the android sdk and databases and have been searching for an answer to this quite some time. I am trying to build an app which has multiple tables within a database. e.g. one for weapons, armours etc. However, my DatabaseManager…
mscriven
  • 11
  • 1
1
vote
2 answers

Storing exception messages in a global location

I would like to have a single location where exception messages are stored (these are not user facing). I also have some exceptions which can have different error messages and codes. These codes are intended only for documentation and communication…
treefrog
  • 1,027
  • 1
  • 15
  • 30
1
vote
3 answers

How do I prevent a cast or making child specific methods in the interface in java?

I have a problem keeping my code maintainable. In my problem I have defined a 'RenderableShape' that is the parent interface of both 2D and 3D shapes (those two are interfaces). I have a Renderer class that 'asks' a RenderableShape for the data to…
RabbitBones22
  • 302
  • 4
  • 16
1
vote
1 answer

Shorten long-template derived-class that passed as template argument into CRTP ("pass me")

I want to pass Derived class as a template parameter Base class. When my Derived class is a template and it is very long, my code has minor maintainability and readability problem, e.g. templateclass Base{ //library : don't…
javaLover
  • 6,347
  • 2
  • 22
  • 67
1
vote
1 answer

avoid duplicated code : typedef/using a template class that has default parameter (C++14)

How to define an alias name of a template class that has default template parameter without code duplication? Does C++14 improve it in some ways? In a real case, it really causes maintainability problem. (demo) class B{}; template
javaLover
  • 6,347
  • 2
  • 22
  • 67
1
vote
2 answers

Technical debt formula doesn't take into account complexity

In Sonarqube versions prior to 5.5 there was the possibility to change the way that technical debt is calculated in order to take into account the complexity, but after 5.5 I can’t see how to change it. Did you remove this configuration? IMHO, the…
1
vote
2 answers

C# Multi-form coding practice

My question is, in general is it allowable and maintainable to have a multi-form program. More specifically in C# is it good practice to have a button go to another form(each button would be in a separate class). Here is an example: (In this example…
Alaa
  • 115
  • 12
1
vote
3 answers

How to show that function belongs to a typedef in C?

If I have a typedef for a function pointer, such as typedef void (* specialFunction) (void); how can I show that I am declaring a function of that type, and not just coincidentally a function with the same signature? I am not trying to enforce…
Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
1
vote
1 answer

In what kind of situations should I not care about the Maintainability Index in Visual Studio's Code Metrics?

I just today stumbled upon the Code Metrics thing, after having used Visual Studio practically every day for... practically my whole life. I think it's been there since around VS2008, but I haven't cared to play with it. Most of my projects in my…
Rei Miyasaka
  • 7,007
  • 6
  • 42
  • 69
1
vote
1 answer

Maintainability issue of refactoring "fA()" and "fB()" to "fAB(){return report;}"

When my program is very young, there are usually many functions that do simple things. When it became older, I found that it is more convenient to bundle some similar functions together, and group the return results of old functions as a "Report". …
javaLover
  • 6,347
  • 2
  • 22
  • 67
1
vote
1 answer

Criteria when using libraries - use Library's data type VS create my own type?

I am coding a game that use many open-source libraries, each library has its own type for representing 3D vector :- Bullet (a Physics engine library) : Vector3. Ogre (a 3D rendering library) : Ogre::Vector3. Eigen (a matrix manipulation library)…
javaLover
  • 6,347
  • 2
  • 22
  • 67
1
vote
1 answer

Syntax for new class declarations in PHP

I inherited a php project that was previously assigned to another development company and I often see very strange code implementations which I've never seen before and which I think are probably errors. That said, they are everywhere and the server…
DrewT
  • 4,983
  • 2
  • 40
  • 53
1
vote
1 answer

How does SonarQube calculate its "Maintainability Rating"?

I believe it uses Technical Debt, Added Technical Debt, Technical Debt Ration, and Technical Debt Ration on New Code. Or does it just use Code Smells? Does anyone understand how this rating is produced? It only provides a rating, not how that rating…
1
vote
3 answers

Why should 'getter' methods in 'Manager' classes not be static?

Conventional programming wisdom seems to discourage the use of static methods in most cases. Often, I have these 'managers' e.g. UserManager, AppointmentManager e.t.c. Invariably, one of the methods in the manager is XXX getXXX(long xxxId) e.g. User…
Emmanuel
  • 322
  • 2
  • 12