eljoujat/eclipseimpexeditor

View on GitHub

Showing 25 of 46 total issues

Method createProposals has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    private CompletionProposal[] createProposals(final String searchPrefix, final int documentOffset,
            final IContextInformation info)
    {
        final List<String> result = new ArrayList<String>();

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 format has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public String format(String content, ImpexDataDefinition impexDataDefinition) {

        Scanner scanner = new Scanner(content);
        List<AbstractBloc> impexBlocs = new ArrayList<>();
        StringBuilder sb=new StringBuilder();

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 evaluateInternal has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public IToken evaluateInternal(ImpexScanner scanner) {
        
        if(scanner.getState().equals("data")){
            return Token.UNDEFINED;
        }

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 evaluateInternal has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public IToken evaluateInternal(ImpexScanner scanner) {
        
        if(scanner.getState().equals("data")){
            return Token.UNDEFINED;
        }

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 isHeaderColumn has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean isHeaderColumn(String entry,String itemType) {

        final List<String> result = new ArrayList<String>();
        boolean isheader=false;

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 buildHttpClient has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public HttpClient buildHttpClient() {
        HttpClient client = null;
        SSLContext sslContext = null;
        try {

    Method format has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public String format(String content, ImpexDataDefinition impexDataDefinition) {
    
            Scanner scanner = new Scanner(content);
            List<AbstractBloc> impexBlocs = new ArrayList<>();
            StringBuilder sb=new StringBuilder();

      Method createProposals has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private CompletionProposal[] createProposals(final String searchPrefix, final int documentOffset,
                  final IContextInformation info)
          {
              final List<String> result = new ArrayList<String>();
      
      

        Method evaluateInternal has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            public IToken evaluateInternal(ImpexScanner scanner) {
        
                    String stream = "";
                    int c = scanner.read();
                    int count = 1;

        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 getMaxLengthPerColumn has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            Map<Integer, Integer> getMaxLengthPerColumn() {
                List<ImpexLine> lines = getLines();
                Map<Integer, Integer> maxLengthPerLine = new HashMap<>();
                for (ImpexLine impexLine : lines) {
                    for (int i = 0; i < impexLine.getEntries().size(); i++) {

        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

        Consider simplifying this complex logical expression.
        Open

                                if((']'== c || ')'==c || '='==c || '['==c || '('==c  || ';'==c ||c=='\n' ||c=='\r' )){
                                    scanner.unread();
                                    impexDataDefinition.addVariableDecalration(stream);
                                    scanner.setState("variable");
                                    return token;

          Method evaluateInternal has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public IToken evaluateInternal(ImpexScanner scanner) {
                  
                  if(scanner.getState().equals("data")){
                      return Token.UNDEFINED;
                  }

            Method evaluateInternal has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public IToken evaluateInternal(ImpexScanner scanner) {
                    
                    if(scanner.getState().equals("data")){
                        return Token.UNDEFINED;
                    }

              Method sendLoginPost has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private String sendLoginPost() {
              
                      final String validJSessionID = getValidJSessionID();
                      String csrfToken = null;
                      try {

                Method sendLoginPost has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    private String sendLoginPost() {
                
                        final String validJSessionID = getValidJSessionID();
                        String csrfToken = null;
                        try {

                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 disableSSLCertificateChecking has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private static void disableSSLCertificateChecking() {
                        HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
                
                            @Override
                            public boolean verify(String hostname, SSLSession session) {

                  Method evaluateInternal has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public IToken evaluateInternal(ImpexScanner scanner) {
                  
                              String stream = "";
                              int c = scanner.read();
                              int count = 1;

                    Consider simplifying this complex logical expression.
                    Open

                                    if('['== c || ';'==c || '('==c || c==' ' || c=='\n' || c=='\r'){
                                        scanner.unread();
                                        scanner.setState("HEADER_ATTR");
                                        return token;
                                        

                      Consider simplifying this complex logical expression.
                      Open

                                      if('['== c || ';'==c || '('==c || c==' ' || c=='\n' || c=='\r'){
                                          scanner.unread();
                                          scanner.setState("HEADER");
                                          scanner.setCurrentType(buffer);
                                          return token;

                        Method createProposal has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            private CompletionProposal createProposal(final int documentOffset,
                                    final String prefix, final String keyword, final IContextInformation info, final Image image)
                          Severity
                          Category
                          Status
                          Source
                          Language