Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all 106942 articles
Browse latest View live

RSRP-471822: "result" to be recognised as a 'special' or 'preferred' name

$
0
0
Reporter Simon Hewitt (simmotech) Simon Hewitt (simmotech)
Created Oct 12, 2018 1:17:37 PM
Updated Oct 17, 2018 4:06:41 PM
Subsystem Code Analysis - C#
Assignee Ivan Serduk (IvanSerduk)
Priority Normal
State Submitted
Type Improvement
Fix version 2018.3
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
I recently came across "dummy", "ignore" and "_" as special names recognised by Resharper to prevent "unused local variable" warning. Nice!

I am aware that you would want the list of "special names" to be kept to an absolute minimum but can I suggest another 'special name' to be recognised by Resharper, albeit in a different manner: "result".

I use "result" very often in functions to denote the value that will be ultimately returned.
I do this rather than use, say, one of the names normally suggested by IntroduceVariable not least so that its value is always shown in a Watch Window no matter which method I am in.

But having an option available that indicates 'result' is to be treated as a special or preferred name would allow a number of refactorings to include it as a possible value at the top of the list when in a function (ie not a method).

RSRP-471848: Import symbol is unused and not resolved in variable

$
0
0
Reporter NN __ (NN) NN __ (NN)
Created Oct 15, 2018 2:18:29 PM
Updated Oct 17, 2018 4:09:32 PM
Subsystem TypeScript
Assignee Nikita Popov (poksh)
Priority Normal
State Submitted
Type Bug
Fix version 2018.3
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
The project is opened as folder (File->Open Folder)
Tested on this project: https://github.com/fuse-box/fuse-box/

ReSharper thinks that 'fs' is not used while in the code (fs.existsSync) it thinks that it is not defined.



import * as path from "path";
import * as fs from "fs";
import * as fsExtra from "fs-extra";
import * as glob from "glob";

const deleteFolderRecursive = p => {
    if (fs.existsSync(p)) {
        fs.readdirSync(p).forEach((file, index) => {
            let curPath = path.join(p, file);
            if (fs.lstatSync(curPath).isDirectory()) {
                // recurse
                deleteFolderRecursive(curPath);
            } else {
                // delete file
                fs.unlinkSync(curPath);
            }
        });
        fs.rmdirSync(p);
    }
};

RSRP-471872: provide setting for the position of the xml / xaml closing tag

$
0
0
Reporter Jeff Stuyvesant (jeffstuy) Jeff Stuyvesant (jeffstuy)
Created Oct 17, 2018 7:42:41 AM
Updated Oct 17, 2018 4:10:55 PM
Subsystem Code Style - Formatter
Assignee Dmitry Osinovsky (Dmitry.Osinovsky)
Priority Normal
State Submitted
Type Improvement
Fix version Backlog
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions

I would like a setting to allow the closing tags for xml and xaml placed / kept on their own line when re-formatted. Or, at least, not re-positioned - that is, kept where I place the closing tag and do not re-position. having the tag on its own line make adding attributes after the last attribute much easier and this allows the re-positioning of the attributes much easier.

RSRP-465638: Variable renaming is broken in latest EAPs

$
0
0
Reporter abdu bukres (abukres) abdu bukres (abukres)
Created Jul 26, 2017 9:06:17 PM
Updated Oct 17, 2018 4:15:39 PM
Resolved Oct 17, 2018 4:15:39 PM
Subsystem Refactorings
Assignee Lilia Shamsutdinova (Lilia.Shamsutdinova)
Priority Normal
State Fixed
Type Bug
Fix version 2018.2
Affected versions 2017.2
Fixed In Version ReSharper Undefined
VsVersion VS 2015 RTM
Sometimes the variable renaming doesn't work right in C#. It's renaming some string literals that are not related the variable I want to rename. The name is not the same but there's no correlation. Also the screen with the checkboxes with the list of objects to rename disappears automatically without giving me the chance to uncheck anything.

RSRP-352742: Context action removes comments

$
0
0
Reporter Yevgeniy Yanavichus (Yevgeniy_Yanavichus) Yevgeniy Yanavichus (Yevgeniy_Yanavichus)
Created Apr 3, 2013 9:47:17 AM
Updated Oct 17, 2018 4:20:39 PM
Resolved Oct 17, 2018 4:20:39 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Obsolete
Type Bug
Fix version Backlog
Affected versions 7.1
Fixed In Version ReSharper Undefined
VsVersion All Versions
Consider the following code:


/// <summary>Does Stuff</summary>
/*
* This comment shouldn't be included in the documentation
*/
public static void DoStuff(int param1, int param2)
{
int sum = param1 + param2;
Console.WriteLine(sum);
}

After executing context action "Insert <param> into header" this code transforms to:


/// <summary>
/// Does Stuff
/// </summary>
/// <param name="param1">
/// The param 1.
/// </param>
/// <param name="param2">
/// The param 2.
/// </param>
public static void DoStuff(int param1, int param2)
{
int sum = param1 + param2;
Console.WriteLine(sum);
}

So, comments are removed.

RSRP-358011: Change Default Parameter modifier

$
0
0
Reporter Wolfgang Jazn (wjanz) Wolfgang Jazn (wjanz)
Created Apr 18, 2013 11:18:33 AM
Updated Oct 17, 2018 4:23:05 PM
Resolved Oct 17, 2018 4:23:05 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Duplicate
Type Feature
Fix version Backlog
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
I would love to see the feature to change the default parameter modifier (ByRef, ByVal, None) e.g. for extracting a method.

Is there any possibility to do this already?
Or is this feature maybe scheduled for a future version?

Best Regards

Wolfgang

RSRP-190715: 'Extract method' cannot change parameter modifier

$
0
0
Reporter JD Stuart (jdstuart) JD Stuart (jdstuart)
Created Sep 10, 2010 7:30:15 AM
Updated Oct 17, 2018 4:23:06 PM
Subsystem Refactorings
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Open
Type Feature
Fix version Backlog
Affected versions 2018.2
Fixed In Version ReSharper Undefined
VsVersion All Versions
When doing 'Extract Method' Ctrl+Alt+M and the 'Extract Method' dialog box pops up with the parameters that will be passed to the method, the modifiers of the parameters cannot be changed from ByVal to ByRef.

[VB]

RSRP-191463: CA "Use var" breaks code

$
0
0
Reporter Drew Noakes (drewnoakes) Drew Noakes (drewnoakes)
Created Sep 26, 2010 7:58:32 PM
Updated Oct 17, 2018 4:30:33 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Improvement
Fix version Backlog
Affected versions 5.1.1, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
double diveTimeMinutes = 0;
The CA "Use var" breaks this code. When a literal value is used, the type should be preserved. R# should convert to either of:

var diveTimeMinutes = 0d;
var diveTimeMinutes = 0.0;
The same is true for all other built-in types for which literal types may be expressed with suffices.

RSRP-358610: The suggestion to use implicit type (var) is not correct in one case, because it can lead to a compilation error later

$
0
0
Reporter Alexander Kurakin (Alexander.Kurakin) Alexander Kurakin (Alexander.Kurakin)
Created Apr 22, 2013 3:24:33 PM
Updated Oct 17, 2018 4:31:08 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Improvement
Fix version Backlog
Affected versions 8.0 EAP, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
Attached

RSRP-359136: Split Into Separate Declarations bug

$
0
0
Reporter Alexander Kurakin (Alexander.Kurakin) Alexander Kurakin (Alexander.Kurakin)
Created Apr 24, 2013 11:55:38 AM
Updated Oct 17, 2018 4:32:47 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Bug
Fix version Backlog
Affected versions 7.1.3, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
string evalId = sqlReader.GetSqlString(1).Value,                  // 1
name = sqlReader.GetSqlString(2).Value, // 2
badgeNum = sqlReader.GetSqlString(3).Value, // 3
title = sqlReader.GetSqlString(4).Value, // 4
currentStepGrade = sqlReader.GetSqlString(5).Value, // 5
anniversaryDate = sqlReader.GetSqlString(6).Value, // 6
hireDate = sqlReader.GetSqlString(7).Value, // 7
periodFrom = sqlReader.GetSqlString(8).Value, // 8
periodTo = sqlReader.GetSqlString(9).Value, // 9
typeInterimNotes = sqlReader.GetSqlString(10).Value; // 10
I have this (above) and when I use "€œSplit Into Separate Declarations"€ I get the following:
string evalId = sqlReader.GetSqlString(1).Value;       // 10
string // 1
name = sqlReader.GetSqlString(2).Value; // 10
string // 1
// 2
badgeNum = sqlReader.GetSqlString(3).Value; // 10
string // 1
// 2
// 3
title = sqlReader.GetSqlString(4).Value; // 10
string // 1
// 2
// 3
// 4
currentStepGrade = sqlReader.GetSqlString(5).Value; // 10
string // 1
// 2
// 3
// 4
// 5
anniversaryDate = sqlReader.GetSqlString(6).Value; // 10
string // 1
// 2
// 3
// 4
// 5
// 6
hireDate = sqlReader.GetSqlString(7).Value; // 10
string // 1
// 2
// 3
// 4
// 5
// 6
// 7
periodFrom = sqlReader.GetSqlString(8).Value; // 10
string // 1
// 2
// 3
// 4
// 5
// 6
// 7
// 8
periodTo = sqlReader.GetSqlString(9).Value; // 10
string // 1
// 2
// 3
// 4
// 5
// 6
// 7
// 8
// 9
typeInterimNotes = sqlReader.GetSqlString(10).Value; // 10

RSRP-471854: Exception during suspending

$
0
0
Reporter Igor Akhmetov (Igor.Akhmetov) Igor Akhmetov (Igor.Akhmetov)
Created Oct 15, 2018 9:14:47 PM
Updated Oct 17, 2018 4:42:43 PM
Subsystem Platform - VS Integration
Assignee Serge Baltic (baltic)
Priority Normal
State Submitted
Type Exception
Fix version 2018.3
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
Latest R# from trunk:
---------------------------
ReSharper – Runtime Error – Technical Data
---------------------------
JetBrains ReSharper has encountered a runtime error.
Technical data follows.
Hint: Ctrl+C copies the text of system message boxes to Clipboard.
________________________________________________________________

There is no component container available in this context while requesting component JetBrains.TextControl.Actions.ITextControlActionExecuter.



--- EXCEPTION #1/2 [InvalidOperationException]

Message = “There is no component container available in this context while requesting component JetBrains.TextControl.Actions.ITextControlActionExecuter.”

ExceptionPath = Root.InnerException

ClassName = System.InvalidOperationException

HResult = COR_E_INVALIDOPERATION=80131509

Source = JetBrains.Platform.Shell

StackTraceString = “

at JetBrains.Application.DataContext.ApplicationDataConstantsExtensions.GetComponent[T](IDataContext dataContext)

at JetBrains.TextControl.Actions.TextControlActionBase.Update(IDataContext context, ActionPresentation presentation, DelegateUpdate nextUpdate)

at JetBrains.Application.UI.ActionsRevised.Handlers.ExecutableActionEvaluator.Evaluate(IAction handler, EvaluatedAction result, IDataContext context)

at JetBrains.ReSharper.Feature.Services.Actions.ServicesActionEvaluator.Evaluate(IAction handler, EvaluatedAction result, IDataContext context)

at JetBrains.Application.UI.ActionsRevised.Handlers.BoundAction.Evaluate(IDataContext context)

at JetBrains.Application.UI.ActionsRevised.Handlers.ActionHandlers.Evaluate(IActionDefWithId action, IDataContext context)

at JetBrains.Application.UI.ActionsRevised.Handlers.ActionHandlersEx.Evaluate(IActionDefWithId actionDef, IActionManager actions, IDataContext dataContext)

at JetBrains.VsIntegration.TextControl.VsTextControlOleCommandTarget.TryDelegateToTypingHandlers_NonTyping(CommandID commandid, Action`1 FExecDelegateBackToVs)

at JetBrains.VsIntegration.TextControl.VsTextControlOleCommandTarget.TryDelegateToTypingHandlers(Boolean bIsTyping, CommandID commandid, IntPtr pvaIn, Action`1 FExecDelegateBackToVsClosed)

at JetBrains.VsIntegration.TextControl.VsTextControlOleCommandTarget.<>c__DisplayClass29_0.<Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.Exec>b__0()





--- Outer ---



--- EXCEPTION #2/2 [LoggerException]

Message = “There is no component container available in this context while requesting component JetBrains.TextControl.Actions.ITextControlActionExecuter.”

ExceptionPath = Root

ClassName = JetBrains.Util.LoggerException

Data.ManagedThreadName = <NULL>

InnerException = “Exception #1 at Root.InnerException”

HResult = COR_E_APPLICATION=80131600

StackTraceString = “

at JetBrains.VsIntegration.TextControl.VsTextControlOleCommandTarget.<>c__DisplayClass29_0.<Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.Exec>b__0()

at JetBrains.Threading.ReentrancyGuard.Execute(String name, Action action)

at JetBrains.Threading.ReentrancyGuard.TryExecute(String name, Action action)

at JetBrains.VsIntegration.TextControl.VsTextControlOleCommandTarget.Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.Exec(Guid& pguidCmdGroupRef, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.SimpleTextViewWindow.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CompoundTextViewWindow.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Platform.WindowManagement.DocumentObjectSite.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)




---------------------------
OK
---------------------------

RSRP-471855: False "Possible 'System.NullReferenceException'"

$
0
0
Reporter Andrey Simukov (Andrey.Simukov) Andrey Simukov (Andrey.Simukov)
Created Oct 15, 2018 10:52:36 PM
Updated Oct 17, 2018 4:43:18 PM
Subsystem Code Analysis - C#
Assignee Ivan Serduk (IvanSerduk)
Priority Normal
State Submitted
Type Bug
Fix version Backlog
Affected versions 2018.2.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
ReSharper does not analyze C# code blow correctly and underlines “response” object with “possible null reference exception”.
if ((response?.CartContactList?.Count).GetValueOrDefault() == 0)
{
throw new Exception("Cart has no contacts.");
}



Another example:

RSRP-377498: "Convert to 'return' statement" suggestion

$
0
0
Reporter Alexander Kurakin (Alexander.Kurakin) Alexander Kurakin (Alexander.Kurakin)
Created Jul 9, 2013 3:14:27 PM
Updated Oct 17, 2018 4:43:45 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Feature
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
I like the "Convert to 'return' statement" re-factoring suggestion and use it often in the middle of a method but never at the end.

Take the following code snippet:
public static Amount operator /(Amount left, Amount right) 
{
if (ReferenceEquals(left, null)) return null;
if (ReferenceEquals(right, null)) return null;

return new Amount(left.value / right.value, left.unit / right.unit);
}
Resharper is offering to merge the second if with the last line:-
return ReferenceEquals(right, null) 
? null
: new Amount(left.value / right.value, left.unit / right.unit);
Whilst this would work, it isn't as easy to read as the first version which I read as "Quick returns where possible to get them out of the way and prevent nesting and then the 'real' code at the bottom (which just happens to be simple in this case"

How about an option to ignore this refactoring when it is offering to combine the last two statements within in a method?

RSRP-471524: Problems with build when ReSharper is enabled

$
0
0
Reporter Tom Harkaway (tharkaway.1) Tom Harkaway (tharkaway.1)
Created Sep 17, 2018 5:51:38 PM
Updated Oct 17, 2018 4:48:11 PM
Resolved Oct 17, 2018 4:48:10 PM
Subsystem Solution builder
Assignee Alexandra Kuks (Asia.Rudenko)
Priority Normal
State Incomplete
Type Unspecified
Fix version No Fix versions
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions

I have come across two issues when building a group of projects in VS2017 when ReSharper is enabled. The solution contains about 60+ projects most of which are C++ projects. I am currently converting the original VC6 projects to VS2017. I currently have 42 of these projects, all of which are C++, converted and compiling properly. I created a build project that builds these 42 projects. When I build this project with ReSharper enabled I get errors that I do not get when I build them with ReSharper disabled.

  1. One of the project's dependencies are not honored. Project A's references include project B. Project B creates a .tlb file, which is moved to a common Bin directory in a Post Build Step using XCopy. Project A looks for this .tlb file in the common Bin directory. This works fine when ReSharper is disabled, but when ReSharper is enabled Project A generates errors because it can't find projects B's .tlb file.

  2. If you rebuild the build project again with Re-Sharper enabled, the .tlb file is found but errors are created in several project, including Project A, because the parameter of several raw... methods defined in the .tlb file have changed from 'char' to 'VARIANT_BOOL'. When you go to the definition of one of the offending raw... methods, you end up looking at a .tli file somewhere in a ReSharper cache directory. The original definition of these method in Project B's .odl file indicates the parameter should be a 'char'.

RSRP-382924: Make X explicit quick fix makes code non-compilable.

$
0
0
Reporter Hadi Hariri (hadihariri) Hadi Hariri (hadihariri)
Created Aug 14, 2013 10:48:42 AM
Updated Oct 17, 2018 4:48:16 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Usability Problem
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions

public class Foo:IFoo
{
public void Bar()
{

}

public void Another()
{
Bar();
}
}

public interface IFoo
{
void Bar();
}

Make Bar explicitly implemented in the class via the Quick Fix and try to compile. Error compiling:

Error    1    The name 'Bar' does not exist in the current context    

RSRP-383000: Convert foreach to for incorrectly handles enumerable creation inside foreach

$
0
0
Reporter Anton Lobov (Anton.Lobov) Anton Lobov (Anton.Lobov)
Created Aug 15, 2013 11:28:20 AM
Updated Oct 17, 2018 4:50:59 PM
Resolved Oct 17, 2018 4:50:59 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Fixed
Type Bug
Fix version Unidentified prior version
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
          foreach (var str in new List<string>())
{
Console.WriteLine(str);
}

converts to
          for (int index = 0; index < new List<string>().Count; index++)
{
var str = new List<string>()[index];
Console.WriteLine(str);
}

RSRP-383001: Context action 'convert foreach to for' does not work for IOrderedEnumerable

$
0
0
Reporter Dmitry Matveev (Dmitry.Matveev) Dmitry Matveev (Dmitry.Matveev)
Created Aug 15, 2013 11:28:33 AM
Updated Oct 17, 2018 4:53:46 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Bug
Fix version Backlog
Affected versions 8.0, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
If we iterate over an implementation of IOrderedEnumerable, the context action 'convert foreach to for' is not available.
e.g:
      foreach (var str in new List<string>().OrderBy(s => s))
{
Console.WriteLine(str);
}

RSRP-383458: Add context action "remove and promote content" for usings, loops, ifs

$
0
0
Reporter Anton Lobov (Anton.Lobov) Anton Lobov (Anton.Lobov)
Created Aug 21, 2013 2:55:11 PM
Updated Oct 17, 2018 5:07:42 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Feature
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
For all code constructs such as usings, loops, ifs and so on it will be very useful if I could apply context action to remove the construct and push it's content to the upper level.

For example, I have a "using" statement which I no longer need:
int m = 5;
var myWrapper = new Wrapper(parent);
using (new MyDisposable()) {
var k = myWrapper.GetValue();
System.out.println(k);
}
Thread.Sleep(1000);

What I desire to see as the result of context action "remove and promote content" on "using":
int m = 5;
var myWrapper = new Wrapper(parent);
var k = myWrapper.GetValue();
System.out.println(k);
Thread.Sleep(1000);

So, it should save me of doing 4 operations (cut / paste / delete / reformat).

(The same already exists for html/xml - "remove tag and promote children", but it would be great to have something similar for c# code blocks constructs.)

RSRP-470872: The “Assembly:Muellerchur.Xamos.Portable.BusinessObjects, Version=1.21.3.621, Culture=neutral, PublicKeyToken=null” lifetime has never been terminated

$
0
0
Reporter Thomas Stocker (thomas.stocker) Thomas Stocker (thomas.stocker)
Created Jul 4, 2018 9:38:46 AM
Updated Oct 17, 2018 5:12:23 PM
Resolved Aug 1, 2018 7:40:30 AM
Subsystem Platform - Project Model
Assignee Slava Tutushkin (slava.tutushkin)
Priority Show-stopper
State Duplicate
Type Exception
Fix version 2018.2
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
ReSharperPlatformVs15 Wave 182 Hive _cb16f37c — JetBrains ReSharper Ultimate 2018.2 EAP 1 Build 182.0.20180628.124316-eap01

JetBrains dotTrace 182 Build 182.0.20180628.132215-eap01
JetBrains ReSharper 182 Build 182.0.20180628.125556-eap01

The “Assembly:Muellerchur.Xamos.Portable.BusinessObjects, Version=1.21.3.621, Culture=neutral, PublicKeyToken=null” lifetime has never been terminated. Some resources might have leaked.

— EXCEPTION #1/3 [InvalidOperationException]
Message = “The “Assembly:Muellerchur.Xamos.Portable.BusinessObjects, Version=1.21.3.621, Culture=neutral, PublicKeyToken=null” lifetime has never been terminated. Some resources might have leaked.”
ExceptionPath = Root.InnerException.InnerException
ClassName = System.InvalidOperationException
HResult = COR_E_INVALIDOPERATION=80131509

— Outer —

— EXCEPTION #2/3 [FinallyException]
Message = “The “Assembly:Muellerchur.Xamos.Portable.BusinessObjects, Version=1.21.3.621, Culture=neutral, PublicKeyToken=null” lifetime has never been terminated. Some resources might have leaked.”
ExceptionPath = Root.InnerException
ClassName = JetBrains.DataFlow.Disposable+FinallyException
Data.CreationStackTrace = “-=[ Stack trace logging disabled. ]=-”
Data.ObjectId = “Assembly:Muellerchur.Xamos.Portable.BusinessObjects, Version=1.21.3.621, Culture=neutral, PublicKeyToken=null”
InnerException = “Exception #1 at Root.InnerException.InnerException”
HResult = COR_E_APPLICATION=80131600
ObjectId = “Assembly:Muellerchur.Xamos.Portable.BusinessObjects, Version=1.21.3.621, Culture=neutral, PublicKeyToken=null”
CreationStackTrace = “-=[ Stack trace logging disabled. ]=-”

— Outer —

— EXCEPTION #3/3 [LoggerException]
Message = “The “Assembly:Muellerchur.Xamos.Portable.BusinessObjects, Version=1.21.3.621, Culture=neutral, PublicKeyToken=null” lifetime has never been terminated. Some resources might have leaked.”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
Data.ManagedThreadName = <NULL>
Data.SccRevisionShell = “<there are no packages matching the criteria>”
Data.HostProductInfo = “JetBrains ReSharper Ultimate 2018.2 EAP 1 Build 182.0.20180628.124316-eap01”
Data.SubProducts.#0 = “JetBrains dotTrace 182 Build 182.0.20180628.132215-eap01”
Data.SubProducts.#1 = “JetBrains ReSharper 182 Build 182.0.20180628.125556-eap01”
Data.SccRevisionEnv = “
Platform\Core\Shell:
    git::refs/heads/182-eap1::389b2b0a5d2b33c46224f8f1850bc61276990d1e


Platform\VisualStudio:
    git::refs/heads/182-eap1

Data.VsVersion = 15.8.27825.0
Data.VsPreview = True
InnerException = “Exception #2 at Root.InnerException”
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
 at JetBrains.DataFlow.Disposable.FinallyException.LogMissedDispose(String id, String message, String sOriginatingStackTrace)
 at JetBrains.DataFlow.Disposable.FinallyException.LogMissedDispose(String id, String message, String sOriginatingStackTrace)
 at JetBrains.DataFlow.Disposable.FinalizableDisposable.Finalize()

RSRP-388211: Invert If statement to reduce nesting (Lines count)

$
0
0
Reporter Дмитрий Бабушкин (Дмитрий.Бабушкин) Дмитрий Бабушкин (Дмитрий.Бабушкин)
Created Oct 4, 2013 3:46:12 PM
Updated Oct 17, 2018 5:12:46 PM
Subsystem Code Analysis - C#
Assignee Ivan Serduk (IvanSerduk)
Priority Normal
State Submitted
Type Usability Problem
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
Приветствую!

Source:
public void Dispose()
{
if (!_disposed)
{
_disposable.Dispose();
_disposed = true;
}
}

After fix:
public void Dispose()
{
if (_disposed) return;
_disposable.Dispose();
_disposed = true;
}

After format:
public void Dispose()
{
if (_disposed)
return;

_disposable.Dispose();
_disposed = true;
}

One question: why?
Please add the setting in which you can specify how many lines Resharepr suggest invert IF (or at least ignore IF in 2 lines).

Спасибо за Ваши труды! :)
Viewing all 106942 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>