Showing 95 of 172 total issues
Method changeDeviceCoord
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public string changeDeviceCoord(string devId, Ball ball)
{
List<Device> devices = readDevices();
if (devices == null || devices.Count == 0 || devices.Exists(d => d.Id == devId))
Method WriteRedirect
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void WriteRedirect(String new_location, int errorNumber)
{
String error = "";
switch (errorNumber)
Method xmlChangeDeviceLocation
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private String xmlChangeDeviceLocation(Device device, Vector3D position)
{
//add device to configuration XML
XmlDocument docConfig = new XmlDocument();
docConfig.Load(AppDomain.CurrentDomain.BaseDirectory + "\\configuration.xml");
Method Send
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public override String Send(String command)
{
HttpWebRequest request = null;
try
{
Method updateDevice
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public string updateDevice(Device dev)
{
List<Device> devices = readDevices();
if (devices == null || devices.Count == 0)
Method updateDevices
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void updateDevices()
{
if (deviceHolder == null || deviceHolder.devices == null)
return;
Method creatTriangleModelRoom
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private ModelVisual3D creatTriangleModelRoom(Point3D p0, Point3D p1, Point3D p2, bool site)
{
ModelVisual3D group = new ModelVisual3D();
MeshGeometry3D triangleMesh = new MeshGeometry3D();
Vector3D normal = new Vector3D();
Method isFileEnding
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public bool isFileEnding(string pathstring)
{
string ending = getFileEnding(pathstring);
switch (ending)
Function updateDeviceList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
var updateDeviceList = function () {
$.getJSON('/?dev=server&cmd=list', function (data) {
var listItems = [];
if (editMode) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function pollDevice
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
var pollDevice = function () {
$.getJSON('/?dev=server&cmd=pollDevice', function (data) {
// restart request if we are still on the ar page
var hash = $.mobile.path.parseLocation().hash;
if (hash == '#ar')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method ReadHeaders
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void ReadHeaders()
{
Debug.WriteLine("readHeaders()");
String line;
while ((line = StreamReadLine(InputStream)) != null)
Function updateProgressBar
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var updateProgressBar = function (curVectors, minVectors) {
if (minVectors <= 0) {
text = curVectors + " Eingaben gespeichert";
// hide progressbar
$('#positionprogressbar').hide();
Method Process
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void Process()
{
// we can't use a StreamReader for input, because it buffers up extra data on us inside it's
// "processed" view of the world, and we want the data raw after the headers
InputStream = new BufferedStream(Socket.GetStream());
Method WindowLoaded
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void WindowLoaded(object sender, RoutedEventArgs e)
{
// Create the drawing group we'll use for drawing
_drawingGroup = new DrawingGroup();
Function updateDeviceList
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var updateDeviceList = function () {
$.getJSON('/?dev=server&cmd=list', function (data) {
var listItems = [];
if (editMode) {
Function selectDevice
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
var selectDevice = function () {
$.getJSON('/?dev=server&cmd=selectDevice', function (data) {
if (!data || !data.devices) {
return;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function RTCPeerConnection
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
window.RTCPeerConnection = function(pcConfig, pcConstraints) {
// Translate iceTransportPolicy to iceTransports,
// see https://code.google.com/p/webrtc/issues/detail?id=4869
if (pcConfig && pcConfig.iceTransportPolicy) {
pcConfig.iceTransports = pcConfig.iceTransportPolicy;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getKinectPosition
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public bool getKinectPosition(Dictionary<String, String> values, out String x, out String y, out String z, out String horizontal, out String tilt)
Avoid deeply nested control flow statements. Open
if (server.hasOwnProperty('urls')) {
for (var j = 0; j < server.urls.length; j++) {
var newServer = {
url: server.urls[j]
};
Avoid deeply nested control flow statements. Open
if ((int)body.TrackingId == ts.Id)
{
RenderClippedEdges(body, dc);
if (body.IsTracked)